diff options
author | Po Lu <luangruo@yahoo.com> | 2021-12-30 11:18:42 +0800 |
---|---|---|
committer | Po Lu <luangruo@yahoo.com> | 2021-12-30 11:18:42 +0800 |
commit | a4893515c249386bca39f1b9a90adc6fc68b48d5 (patch) | |
tree | 7fcd4d246c21cac816e1a0225288bab65a276519 | |
parent | b88024ad1aa0c2e75b407634038050a653fdb64b (diff) | |
download | emacs-a4893515c249386bca39f1b9a90adc6fc68b48d5.tar.gz emacs-a4893515c249386bca39f1b9a90adc6fc68b48d5.tar.bz2 emacs-a4893515c249386bca39f1b9a90adc6fc68b48d5.zip |
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.
-rw-r--r-- | src/xterm.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/xterm.c b/src/xterm.c index 61dff7aaab6..afac07e7ff2 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; } |