summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPo Lu <luangruo@yahoo.com>2022-06-20 09:17:21 +0800
committerPo Lu <luangruo@yahoo.com>2022-06-20 09:17:21 +0800
commit9a6b6b1887c62b2f5aee75e213bd1f62bc6577f6 (patch)
treeaea4bb6b9953f415b259f1b2668bee9926a93fb4 /src
parent772c0e6f20f789862883e42181dd16a6ac3cb0f6 (diff)
downloademacs-9a6b6b1887c62b2f5aee75e213bd1f62bc6577f6.tar.gz
emacs-9a6b6b1887c62b2f5aee75e213bd1f62bc6577f6.tar.bz2
emacs-9a6b6b1887c62b2f5aee75e213bd1f62bc6577f6.zip
Don't generate superfluous wheel events during drag and drop
* src/xterm.c (handle_one_xevent): Only set user time and don't create wheel events if DND is in progress.
Diffstat (limited to 'src')
-rw-r--r--src/xterm.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/src/xterm.c b/src/xterm.c
index 9a31f9ea094..12d091c1d92 100644
--- a/src/xterm.c
+++ b/src/xterm.c
@@ -19609,6 +19609,7 @@ handle_one_xevent (struct x_display_info *dpyinfo,
x_display_set_last_user_time (dpyinfo, xev->time,
xev->send_event);
+
#if defined USE_GTK && !defined HAVE_GTK3
/* Unlike on Motif, we can't select for XI
events on the scroll bar window under GTK+ 2.
@@ -19623,6 +19624,15 @@ handle_one_xevent (struct x_display_info *dpyinfo,
goto XI_OTHER;
#endif
+ /* If this happened during a drag-and-drop
+ operation, don't send an event. We only have
+ to set the user time. */
+ if (x_dnd_in_progress
+ && (command_loop_level + minibuf_level
+ <= x_dnd_recursion_depth)
+ && dpyinfo == FRAME_DISPLAY_INFO (x_dnd_frame))
+ goto XI_OTHER;
+
if (fabs (total_x) > 0 || fabs (total_y) > 0)
{
inev.ie.kind = (fabs (total_y) >= fabs (total_x)
@@ -20853,8 +20863,7 @@ handle_one_xevent (struct x_display_info *dpyinfo,
#endif
XSETFRAME (inev.ie.frame_or_window, f);
- inev.ie.modifiers
- = x_x_to_emacs_modifiers (FRAME_DISPLAY_INFO (f), state);
+ inev.ie.modifiers = x_x_to_emacs_modifiers (dpyinfo, state);
inev.ie.timestamp = xev->time;
#ifdef HAVE_X_I18N