emacs-diffs
[Top][All Lists]
Advanced

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

master a4893515c2: Work around xwidgets releasing the passive grab on an


From: Po Lu
Subject: master a4893515c2: Work around xwidgets releasing the passive grab on an entry event
Date: Wed, 29 Dec 2021 22:19:23 -0500 (EST)

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

    Work around xwidgets releasing the passive grab on an entry event
    
    * src/xterm.c (handle_one_xevent): Don't send XI_Enter events to
    xwidgets if button 1 is pressed.
---
 src/xterm.c | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/src/xterm.c b/src/xterm.c
index 61dff7aaab..afac07e7ff 100644
--- a/src/xterm.c
+++ b/src/xterm.c
@@ -10011,8 +10011,14 @@ handle_one_xevent (struct x_display_info *dpyinfo,
 #ifdef HAVE_XWIDGETS
              if (xwidget_view)
                {
-                 *finish = X_EVENT_DROP;
-                 xwidget_motion_or_crossing (xwidget_view, event);
+                 /* Don't send an enter event to the xwidget if the
+                    first button is pressed, to avoid it releasing
+                    the passive grab.  I don't know why that happens,
+                    but this workaround makes dragging to select text
+                    work again.  */
+                 if (!(enter->buttons.mask_len
+                       && XIMaskIsSet (enter->buttons.mask, 1)))
+                   xwidget_motion_or_crossing (xwidget_view, event);
 
                  goto XI_OTHER;
                }



reply via email to

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