aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPo Lu2022-06-19 15:21:46 +0800
committerPo Lu2022-06-19 15:21:46 +0800
commit76f3878e287542ffaa40126528fc0cb2dc6a2a3d (patch)
tree477736128112e5d6c21a018aa258ea25e7f035e0
parent823b503c9da3d69a369bfeb1c2496cd22933360a (diff)
downloademacs-76f3878e287542ffaa40126528fc0cb2dc6a2a3d.tar.gz
emacs-76f3878e287542ffaa40126528fc0cb2dc6a2a3d.zip
Ignore emulated mouse clicks during drag-and-drop
* src/xterm.c (handle_one_xevent): Don't set dpyinfo->grab and last mouse frame for emulated mouse events during a drag-and-drop operation.
-rw-r--r--src/xterm.c28
1 files changed, 19 insertions, 9 deletions
diff --git a/src/xterm.c b/src/xterm.c
index 455d5b795e9..1af0f41937d 100644
--- a/src/xterm.c
+++ b/src/xterm.c
@@ -20050,19 +20050,29 @@ handle_one_xevent (struct x_display_info *dpyinfo,
20050 { 20050 {
20051 f = mouse_or_wdesc_frame (dpyinfo, xev->event); 20051 f = mouse_or_wdesc_frame (dpyinfo, xev->event);
20052 20052
20053 if (xev->evtype == XI_ButtonPress) 20053 /* Don't track grab status for emulated pointer
20054 events, because they are ignored by the regular
20055 mouse click processing code. */
20056#ifdef XIPointerEmulated
20057 if (!(xev->flags & XIPointerEmulated))
20054 { 20058 {
20055 dpyinfo->grabbed |= (1 << xev->detail); 20059#endif
20056 dpyinfo->last_mouse_frame = f; 20060 if (xev->evtype == XI_ButtonPress)
20057 if (f && !tab_bar_p) 20061 {
20058 f->last_tab_bar_item = -1; 20062 dpyinfo->grabbed |= (1 << xev->detail);
20063 dpyinfo->last_mouse_frame = f;
20064 if (f && !tab_bar_p)
20065 f->last_tab_bar_item = -1;
20059#if ! defined (USE_GTK) 20066#if ! defined (USE_GTK)
20060 if (f && !tool_bar_p) 20067 if (f && !tool_bar_p)
20061 f->last_tool_bar_item = -1; 20068 f->last_tool_bar_item = -1;
20062#endif /* not USE_GTK */ 20069#endif /* not USE_GTK */
20070 }
20071 else
20072 dpyinfo->grabbed &= ~(1 << xev->detail);
20073#ifdef XIPointerEmulated
20063 } 20074 }
20064 else 20075#endif
20065 dpyinfo->grabbed &= ~(1 << xev->detail);
20066 20076
20067 if (xev->evtype == XI_ButtonPress 20077 if (xev->evtype == XI_ButtonPress
20068 && x_dnd_last_seen_window != None 20078 && x_dnd_last_seen_window != None