Commit graph

45765 commits

Author SHA1 Message Date
Po Lu
021dbdb128 * src/xterm.c (x_dnd_begin_drag_and_drop): Fix test against DND frame. 2022-03-23 11:14:28 +08:00
Po Lu
bd2734f0b6 Don't allocate duplicate cursors for each frame on Haiku
* src/haikufns.c (haiku_create_frame)
(haiku_free_frame_resources): Stop creating cursors.
* src/haikuterm.c (haiku_delete_terminal, haiku_term_init):
Create and free cursors here instead.
* src/haikuterm.h (struct haiku_display_info): New fields for
cursors.
2022-03-23 02:27:21 +00:00
Po Lu
9cef919692 Improve DND documentation
* doc/lispref/frames.texi (Drag and Drop):
* src/xfns.c (Fx_begin_drag): Document meaning of
`XdndActionPrivate'.
2022-03-23 09:26:50 +08:00
Po Lu
dd242b49ec ; * src/xterm.c (x_free_frame_resources): Fix typo in last change. 2022-03-23 09:21:19 +08:00
Po Lu
8b853b3f98 Reported taken action correctly when dragging to another frame on X
* src/xterm.c (x_dnd_cleanup_drag_and_drop, x_dnd_update_state)
(x_free_frame_resources, handle_one_xevent): Set
`x_dnd_end_window'.
(x_dnd_begin_drag_and_drop): Return `XdndActionPrivate' if the
drop landed on one of our own frames.
2022-03-23 09:21:04 +08:00
Lars Ingebrigtsen
601e0d992e Mention highlight-confusing-reorderings in doc string
* src/xdisp.c (Fbidi_find_overridden_directionality): Mention
highlight-confusing-reorderings.
2022-03-22 23:44:16 +01:00
Lars Ingebrigtsen
5e5bc0c0bc Mention the other-window-scroll-default user option
* src/window.c (Fscroll_other_window): Link to
other-window-scroll-default in the doc string.
2022-03-22 23:40:08 +01:00
Lars Ingebrigtsen
a0e3385070 Fix a keyboard.c no-X compilation warning
* src/keyboard.c (make_lispy_position): Fix compilation warning in
a --without-x build.
2022-03-22 21:09:16 +01:00
Po Lu
8757551da0 Simplify fullscreen management on Haiku
* src/haiku_support.cc (class EmacsWindow, Zoom, UnZoom): Track
zoom state manually instead of guessing what the system
currently thinks it is.
(MakeFullscreen): Always unzoom first.
* src/haiku_support.h (struct haiku_zoom_event): Remove all
fields and add a single field `zoomed'.
* src/haikufns.c (haiku_create_frame, haiku_create_tip_frame):
Remove use of pending_zoom fields.
* src/haikuterm.c (haiku_read_socket): Simplify handling of zoom
events.
(haiku_fullscreen): Simplify handling of different zoom states.
* src/haikuterm.h (struct haiku_output): Remove all pending_zoom
fields since they are no longer required.
2022-03-22 11:27:42 +00:00
Andrea Corallo
7872d496d5 * src/comp.c: Few improvements following 71b8f1fc63.
* src/comp.c (ABI_VERSION): Update.
(Fcomp__register_lambda, Fcomp__register_subr): Remove unnecessary
check.
* src/comp.c (Fcomp__register_lambda, Fcomp__register_subr):
Remove unnecessary change.
2022-03-22 09:43:28 +01:00
Po Lu
b10dcd0c88 * src/xterm.c (x_dnd_get_window_proto): Don't return huge protocols. 2022-03-22 16:27:23 +08:00
Po Lu
966ec5dae6 Fix starting Emacs with -mm or -fs on Haiku
* src/haikuterm.c (haiku_set_window_size): Disallow setting the
window size if the frame is fullscreen, like most X window
managers.
2022-03-22 02:46:46 +00:00
Po Lu
df5fb5fafa Fix leak of saved menu event and output data
* src/xterm.c (x_destroy_window, x_free_frame_resources): Free
output data and saved menu event even if display is closed.
2022-03-22 08:39:55 +08:00
Andrea Corallo
59a8a0ef0d ; * src/comp.c: Update a comment. 2022-03-21 15:27:48 +01:00
Po Lu
efb76604c4 Minor fixes to Haiku DND support
* src/haiku_support.cc (MessageReceived): If source is remote,
don't test window ID.
(MouseMoved): Don't send mouse motion if dragging.
(be_drag_message): Return true if quit-flag.
* src/haiku_support.h: Update prototypes.
* src/haikuselect.c (haiku_should_quit_drag): New function.
(Fhaiku_drag_message): If rc is true, quit.
2022-03-21 09:01:31 +00:00
Po Lu
a379f50acb Improve handling of input methods during drag-and-drop
* src/xterm.c (x_dnd_cleanup_drag_and_drop)
(x_dnd_begin_drag_and_drop): Stop removing IC and filter events
before dispatching them.
(x_filter_event): Actually filter events during DND.
(XTread_socket): Verify GenericEvents are actually input
extension events before ignoring them.
2022-03-21 11:48:36 +08:00
Po Lu
2af8b18b2a Make quitting work while DND is waitng for finish
* src/xterm.c (x_dnd_cleanup_drag_and_drop):
(x_dnd_begin_drag_and_drop, handle_one_xevent)
(x_free_frame_resources): Clear waiting for finish flag.
(x_filter_event): Don't filter if waiting for DND finish as
well.
2022-03-21 09:34:21 +08:00
Paul Eggert
5feddb4b1a Remove duplicate INLINE_HEADER_BEGIN
* src/thread.h: Remove duplicate INLINE_HEADER_BEGIN.
Problem reportd by Mattias Engdegård.
2022-03-20 10:46:45 -07:00
Po Lu
0afef91fa1 Fix confusion of wanted action with actual action on X
* src/xterm.c (x_dnd_begin_drag_and_drop)
(x_dnd_update_state, handle_one_xevent): Differentiate between
wanted action and chosen action correctly.
2022-03-20 21:21:43 +08:00
Po Lu
e1178eb640 Make DND between frames work properly
* src/xterm.c (handle_one_xevent): Don't wait for a finish event
when dropping on top of another Emacs frame.
2022-03-20 16:21:45 +08:00
Po Lu
9b34005c32 Improve compliance with version 5 of the XDND specification
* src/xterm.c (x_dnd_cleanup_drag_and_drop): New function.
(x_dnd_begin_drag_and_drop): Handle selection request events
immediately.
(handle_one_xevent): Wait for XdndFinished events and return the
action chosen there.
2022-03-20 15:00:36 +08:00
Po Lu
34ac8088b0 Fix some crashes in shut_down_emacs on Haiku
* src/emacs.c (shut_down_emacs): Stop quitting be app, since
it's not always there.
2022-03-20 05:53:30 +00:00
Po Lu
a232a8a22c Implement `haiku_delete_terminal'
* src/haikuterm.c (haiku_delete_terminal): Actually delete the
terminal instead of aborting.
2022-03-20 05:52:30 +00:00
Po Lu
b19b9cbe51 Check list tail properly in x-begin-drag
* src/xfns.c (Fx_begin_drag): Check that TARGETS is actually a
proper list.
* src/xterm.c (x_dnd_update_state): Remove debugging code.
2022-03-20 12:51:46 +08:00
Po Lu
629ac0803f Fix crash on some compositing managers
* src/xterm.c (x_dnd_get_target_window): Catch errors around
CompositeReleaseOverlayWindow.
2022-03-20 11:23:11 +08:00
Po Lu
77f5eb874b Improve behaviour of drag-n-drop during window manager operations
* src/xterm.c (x_dnd_begin_drag_and_drop): Select for some
events on the root window.
(x_dnd_update_state): New function.
(handle_one_xevent): Call that function when we get some events
from the root window substructure or the window manager.
(x_term_init): New atom `_NET_CLIENT_LIST_STACKING'.
* src/xterm.h (struct x_display_info): New atom
`_NET_CLIENT_LIST_STACKING'.
2022-03-20 09:53:52 +08:00
Eli Zaretskii
d2ac7447db Merge branch 'master' of git.savannah.gnu.org:/srv/git/emacs 2022-03-19 22:18:47 +02:00
Paul Eggert
ccf4a4fa48 Port to gcc -D EMACS_EXTERN_INLINE
* src/comp.h, src/thread.h: Add INLINE_HEADER_BEGIN and
INLINE_HEADER_END, since it uses INLINE.
* src/emacs.c: Include these two files.
2022-03-19 12:48:54 -07:00
Paul Eggert
c11b4758b7 valid_sp inline fix
* src/bytecode.c (valid_sp): static, not INLINE, as INLINE
should be used only in headers and between INLINE_HEADER_BEGIN
and INLINE_HEADER_END.  No need for ‘inline’ here.
2022-03-19 12:48:54 -07:00
Paul Eggert
495d8519ca Simplify alloc.c static function decls
* src/alloc.c: Omit unnecessary static function declarations.
Don’t use ‘inline static’ as the C standard says that keyword
order is obsolescent.  Anyway, no need for ‘inline’ as compilers
inline without it well enough.
2022-03-19 12:48:53 -07:00
Paul Eggert
c386f7e825 Make native helper functions static
These don’t need to be extern, even with -flto, since
their addresses are taken.
* src/comp.c (helper_unwind_protect, helper_unbind_n)
(helper_save_restriction, helper_GET_SYMBOL_WITH_POSITION)
(helper_PSEUDOVECTOR_TYPEP_XUNTAG): Now static.
2022-03-19 12:48:53 -07:00
Paul Eggert
0fed561042 Remove unused fns/data and make fns static
* src/comp.c (saved_sigset, helper_temp_output_buffer_setup):
Remove; unused.
* src/comp.c (logfile, helper_link_table):
* src/fns.c (hashfn_equal, hashfn_eql):
* src/frame.c (frame_windows_min_size):
* src/gnutls.c (emacs_gnutls_global_init):
* src/minibuf.c (Vcommand_loop_level_list):
* src/syntax.c (syntax_code_spec):
* src/timefns.c (time_overflow):
* src/xterm.c (x_xrender_color_from_gc_foreground)
(x_display_set_last_user_time):
Now static, since it’s not used elsewhere.
* src/xterm.c (x_xrender_color_from_gc_foreground)
(x_xrender_color_from_gc_background): Move earlier to avoid
forward use.
(x_xrender_color_from_gc_foreground): Do not define unless
!defined USE_CAIRO && (RENDER_MAJOR > 0 || RENDER_MINOR >= 2),
since it’s not used otherwise.
2022-03-19 12:48:53 -07:00
Paul Eggert
c3c5e50ba4 Use filenvercmp instead of doing it by hand
* src/fns.c (Fstring_version_lessp): Use filenvercmp,
not string_version_cmp.
(string_version_cmp): Remove; no longer used.
2022-03-19 12:48:52 -07:00
Paul Eggert
a5cbd98376 Omit unnecessary code when !HAVE_NATIVE_COMP
* src/decompress.c (MD5_BLOCKSIZE, acc_buf, acc_size)
(accumulate_and_process_md5, final_process_md5, md5_gz_stream):
* src/dynlib.c (dynlib_open_for_eln, dynlib_close) [!WINDOWSNT]:
* src/fileio.c (internal_delete_file_1, internal_delete_file):
Define only if HAVE_NATIVE_COMP && WINDOWSNT,
as they’re not used otherwise.
2022-03-19 12:48:52 -07:00
Paul Eggert
abfb76732c Remove internal_condition_case_[345]
* src/comp.c (directory_files_matching) [WINDOWSNT]: New function.
(eln_load_path_final_clean_up) [WINDOWSNT]: Use it.
This removes the need for internal_condition_case_5.
* src/eval.c (internal_condition_case_3)
(internal_condition_case_4, internal_condition_case_5): Remove.
The first two were never used; the last only in now-removed code.
2022-03-19 12:48:51 -07:00
Paul Eggert
035e8e4d45 Remove sanitize_window_sizes
* src/window.c (sanitize_window_sizes): Remove; no-longer-used.
A previous refactoring moved this to Lisp without removing the C code.
2022-03-19 12:48:51 -07:00
Eli Zaretskii
6887bf555f Merge branch 'master' of git.savannah.gnu.org:/srv/git/emacs 2022-03-19 17:19:19 +02:00
Lars Ingebrigtsen
71b8f1fc63 Make `command-modes' work for (native-compiled) subrs, too
* lisp/emacs-lisp/comp.el (comp-func): Add a command-modes slot.
(comp-spill-lap-function, comp-intern-func-in-ctxt): Fill it.
(comp-emit-for-top-level, comp-emit-lambda-for-top-level): Use it.

* src/alloc.c (mark_object): Mark the command_modes slot.

* src/comp.c (make_subr): Add a command_modes parameter.
(Fcomp__register_lambda): Use it.
(Fcomp__register_subr): Ditto.

* src/data.c (Fcommand_modes): Output the command_modes data for subrs
(bug#54437).

* src/lisp.h (GCALIGNED_STRUCT): Add a command_modes slot.

* src/pdumper.c (dump_subr): Update hash.
(dump_subr): Dump the command_modes slot.
2022-03-19 15:11:37 +01:00
Po Lu
c79e0188e8 Improve protection against faulty clients during DND
* src/xterm.c (x_dnd_send_enter, x_dnd_send_position)
(xdnd_send_leave, x_dnd_send_drop): Catch errors around call to
XSendEvent.  The target window could be gone.
2022-03-19 18:47:44 +08:00
Eli Zaretskii
9c68894399 Merge from origin/emacs-28
e059d7c Fix region highlight in non-selected windows
2022-03-19 09:25:19 +02:00
Eli Zaretskii
e059d7c156 Fix region highlight in non-selected windows
* src/xdisp.c (prepare_menu_bars): Include in the windows passed
to pre-redisplay-functions windows whose point was moved from the
last recorded position.  (Bug#54450)
2022-03-19 09:19:53 +02:00
Po Lu
43ee6f291d Ignore drag source frame on Haiku in line with documentation
* src/haiku_support.cc (class EmacsWindow): New field
`window_id'.
(MessageReceived): Ignore dropped messages with same window id.
(be_drag_message): Add source frame's window ID to message.
2022-03-19 07:00:28 +00:00
Po Lu
d2ba793ed9 * src/xterm.c (XTread_socket): Don't filter GenericEvents. 2022-03-19 10:52:27 +08:00
Po Lu
1467b04f5c Handle composite overlay window during drag and drop sessions
* configure.ac: Test for the composite extension and use it if
available.
* msdos/sed1v2.inp: Update.
* src/Makefile.in (XCOMPOSITE_LIBS, XCOMPOSITE_CFLAGS): New
variables.
(EMACS_CFLAGS, LIBES): Add new libs and cflags.
* src/xterm.c (x_dnd_get_target_window): Look for proxy on
composite overlay window if mapped.
(x_term_init): Test if the composite extension is available.
* src/xterm.h (struct x_display_info): New fields for composite
extension presence.
2022-03-19 09:29:08 +08:00
Po Lu
ae9a0b7808 Fix some XIM servers getting confused during drag-and-drop
* src/xterm.c (x_dnd_begin_drag_and_drop): Clear XIC while event
loop is in progress.
(x_filter_event): Return 0 if DND is in progress.
(xim_instantiate_callback): Likewise.
2022-03-19 07:45:14 +08:00
Mattias Engdegård
4d61badad1 Speed up fixnum printing
Use the new number-to-string code to speed up fixnum printing, with
similar results (often more than twice as fast as before).

* src/data.c (Fnumber_to_string): Move fixnum conversion to...
(fixnum_to_string): ... this new function.
* src/lisp.h: (fixnum_to_string): External declaration.
* src/print.c (print_object): Use fixnum_to_string instead of sprintf.
2022-03-18 13:58:36 +01:00
Mattias Engdegård
ce26657b5d Speed up number-to-string for fixnums
Do the binary-to-decimal conversion by hand for fixnums instead of
calling sprintf.  This results in a noticeable speed increase (on my
machine, 2.2× faster excluding GC).

* src/data.c (Fnumber_to_string): Don't use sprintf for fixnums.
2022-03-18 11:54:08 +01:00
Po Lu
2b05a06786 Implement drag-and-drop of files on Haiku
* lisp/term/haiku-win.el (haiku-dnd-selection-converters): Add
new selection converter.
(haiku-dnd-convert-uri-list): New function.
(x-begin-drag): Allow selection converters to change message
field type.

* src/haikuselect.c (haiku_lisp_to_message): Perform more error
checking.
2022-03-18 09:22:13 +00:00
Po Lu
a96f6de544 Allow dragging messages with file names on Haiku
* src/haiku_select.cc (be_add_refs_data): New function.
* src/haikuselect.c (haiku_lisp_to_message): Handle `ref' type
correctly.
* src/haikuselect.h: Update prototypes.
2022-03-18 05:48:10 +00:00
Po Lu
45609c347e Allow dragging files from Dired to other programs
* etc/NEWS: Announce new user option `dired-mouse-drag-files'.
* lisp/dired.el (dired-mouse-drag-files): New user option.
(dired-mouse-drag): New command.
(dired-mouse-drag-files-map): New variable.
(dired-insert-set-properties): Add additional keymap if mouse
dragging is enabled.

* lisp/select.el (xselect-convert-to-targets): Handle new
form of selection converters.
(xselect-convert-to-username):
(xselect-convert-to-text-uri-list):
(xselect-uri-list-available-p): New functions.
(selection-converter-alist): Add them as selection converters.

* src/xselect.c (x_get_local_selection): Handle new form of
selection converters.
(syms_of_xselect): Update doc strings.
2022-03-18 13:17:19 +08:00