emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

master 76f3878e28: Ignore emulated mouse clicks during drag-and-drop


From: Po Lu
Subject: master 76f3878e28: Ignore emulated mouse clicks during drag-and-drop
Date: Sun, 19 Jun 2022 03:21:57 -0400 (EDT)

branch: master
commit 76f3878e287542ffaa40126528fc0cb2dc6a2a3d
Author: Po Lu <luangruo@yahoo.com>
Commit: Po Lu <luangruo@yahoo.com>

    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.
---
 src/xterm.c | 28 +++++++++++++++++++---------
 1 file changed, 19 insertions(+), 9 deletions(-)

diff --git a/src/xterm.c b/src/xterm.c
index 455d5b795e..1af0f41937 100644
--- a/src/xterm.c
+++ b/src/xterm.c
@@ -20050,19 +20050,29 @@ handle_one_xevent (struct x_display_info *dpyinfo,
                {
                  f = mouse_or_wdesc_frame (dpyinfo, xev->event);
 
-                 if (xev->evtype == XI_ButtonPress)
+                 /* Don't track grab status for emulated pointer
+                    events, because they are ignored by the regular
+                    mouse click processing code.  */
+#ifdef XIPointerEmulated
+                 if (!(xev->flags & XIPointerEmulated))
                    {
-                     dpyinfo->grabbed |= (1 << xev->detail);
-                     dpyinfo->last_mouse_frame = f;
-                     if (f && !tab_bar_p)
-                       f->last_tab_bar_item = -1;
+#endif
+                     if (xev->evtype == XI_ButtonPress)
+                       {
+                         dpyinfo->grabbed |= (1 << xev->detail);
+                         dpyinfo->last_mouse_frame = f;
+                         if (f && !tab_bar_p)
+                           f->last_tab_bar_item = -1;
 #if ! defined (USE_GTK)
-                     if (f && !tool_bar_p)
-                       f->last_tool_bar_item = -1;
+                         if (f && !tool_bar_p)
+                           f->last_tool_bar_item = -1;
 #endif /* not USE_GTK */
+                       }
+                     else
+                       dpyinfo->grabbed &= ~(1 << xev->detail);
+#ifdef XIPointerEmulated
                    }
-                 else
-                   dpyinfo->grabbed &= ~(1 << xev->detail);
+#endif
 
                  if (xev->evtype == XI_ButtonPress
                      && x_dnd_last_seen_window != None



reply via email to

[Prev in Thread] Current Thread [Next in Thread]