]> git.eshelyaron.com Git - emacs.git/commitdiff
Work around xwidgets releasing the passive grab on an entry event
authorPo Lu <luangruo@yahoo.com>
Thu, 30 Dec 2021 03:18:42 +0000 (11:18 +0800)
committerPo Lu <luangruo@yahoo.com>
Thu, 30 Dec 2021 03:18:42 +0000 (11:18 +0800)
* src/xterm.c (handle_one_xevent): Don't send XI_Enter events to
xwidgets if button 1 is pressed.

src/xterm.c

index 61dff7aaab66d807f35f60fbe339b1cde3b6f6f9..afac07e7ff20684be96796556632aec7fdccc10e 100644 (file)
@@ -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;
                }