1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2025-12-26 07:11:34 -08:00
Commit graph

45777 commits

Author SHA1 Message Date
Po Lu
b4fc5bedb8 Use _NET_CLIENT_LIST_STACKING to optimize drag and drop window discovery
* src/xterm.c (struct x_client_list_window): New struct.
(x_dnd_free_toplevels, x_dnd_compute_toplevels)
(x_dnd_get_target_window_1): New functions.
(x_dnd_get_target_window): Search in the toplevel list if it
exists.
(x_dnd_cleanup_drag_and_drop): Clean up toplevel list.
(x_dnd_begin_drag_and_drop): Compute toplevel list if the
window manager supports it.
(handle_one_xevent): Update the toplevel list if prudent.
2022-03-25 11:09:43 +08:00
Po Lu
380f0443b2 Allow fetching events from other displays inside DND
* src/xterm.c (x_dnd_begin_drag_and_drop): Get the next event
from the app connection instead on Xt.
2022-03-24 21:25:32 +08:00
Po Lu
f09e68e180 Avoid crashes if async input arrives when setting properties for DND
* src/xterm.c (x_dnd_begin_drag_and_drop): Block input around
non-async signal safe functions.
2022-03-24 17:00:43 +08:00
Lars Ingebrigtsen
9856290806 Mention frame-text-* function in frame-pixel-* doc strings
* src/frame.c (Fframe_native_width, Fframe_native_height): Link to
`frame-text-*' functions.
2022-03-24 10:00:09 +01:00
Po Lu
cae187e430 Fix some bugs with drag and drop and Mozilla
* src/xfns.c (Fx_begin_drag): Call maybe_quit when iterating
through potentially long lists.  Also allow specifying
XdndActionAsk manually again, since it's useful for debugging.
* src/xterm.c (x_dnd_begin_drag_and_drop): Delete XdndActionList
and XdndActionDescription if they were not specified.
2022-03-24 16:39:23 +08:00
Po Lu
97f9eeaaef Allow holding down scroll bar buttons on Haiku when overscrolling
* src/haiku_support.cc (EmacsWindow): Set appropriate pulse
rate.
(class EmacsScrollBar, ValueChanged): Don't send any part events
here.
(MouseDown): Set dragging to a value larger than 1 if the scroll
bar is at the end.
(Pulse): New method.
2022-03-24 05:32:34 +00:00
Po Lu
ebd5725e0b Fix an infinite loop if the window manager pings Emacs during DND
* src/xterm.c (handle_one_xevent): Work around _NET_WM_PING
infinite loop during drag and drop.
2022-03-24 11:41:29 +08:00
Po Lu
d81df9e449 Fix copying font names around on Haiku
* src/haiku_font_support.cc (font_style_to_flags)
(haiku_font_fill_pattern, BFont_open_pattern)
(BFont_populate_fixed_family, BFont_populate_plain_family):
* src/haiku_support.cc (be_get_version_string):
* src/haikufont.c (haikufont_spec_or_entity_to_pattern): Stop
assuming patterns were allocated by xzalloc.
2022-03-24 01:50:18 +00:00
Po Lu
17393c0db0 Allow dragging and dropping multiple actions
* doc/lispref/frames.texi (Drag and Drop): Document new meaning
of `action'.
* lisp/term/haiku-win.el (x-begin-drag): Correct for new meaning
of `action'.
* src/xfns.c (Fx_begin_drag): Handle new alist meaning of
`action'.
* src/xterm.c (x_dnd_begin_drag_and_drop): New parameters
`ask_action_list', `ask_action_names' and `n_ask_actions'.
* src/xterm.h: Update prototypes.
2022-03-24 09:42:47 +08:00
Po Lu
7fa5d6c87d Improvements to Haiku selection handling
* lisp/term/haiku-win.el (haiku-selection-targets): Implement in Lisp.
* src/haiku_select.cc (be_get_message_type):
(be_set_message_type):
(be_get_message_message):
(be_add_message_message): New functions.

* src/haiku_support.cc (MessageReceived): Fix typo.
* src/haikuselect.c (haiku_selection_data_1)
(Fhaiku_selection_targets): Delete functions.
(haiku_message_to_lisp, lisp_to_type_code)
(haiku_lisp_to_message): Correctly decode and encode nested
messages, and fix encoding specially decoded types via numeric
names.  Also store and decode message types inside Lisp
messages.
(Fhaiku_drag_message): Update doc string.
(syms_of_haikuselect): Update subrs.
* src/haikuselect.h: Update prototypes.
2022-03-23 14:16:15 +00:00
Po Lu
fed9a353db Allow retrieving some more kinds of clipboard data on Haiku
* src/haiku_select.cc (BClipboard_find_data): Handle NULL
characters inside data correctly.
(be_lock_clipboard_message, be_unlock_clipboard): New functions.
* src/haikuselect.c (Fhaiku_selection_data): Return entire
clipboard contents as a message when clipboard is NULL.
(haiku_lisp_to_message): Allow quitting when iterating through
potentially large or circular lists.
* src/haikuselect.h (enum haiku_clipboard): New enum.
2022-03-23 08:20:14 +00:00
Po Lu
64aabe706f Fix crash in haiku_message_to_lisp
* src/haikuselect.c (haiku_message_to_lisp): Block input around
`free'.
2022-03-23 04:01:01 +00:00
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