[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
master 5bedef8f87 1/2: Fix bug#57476
From: |
Po Lu |
Subject: |
master 5bedef8f87 1/2: Fix bug#57476 |
Date: |
Tue, 30 Aug 2022 22:18:02 -0400 (EDT) |
branch: master
commit 5bedef8f87d2103e21342a06c4c1c9d7efe06621
Author: Po Lu <luangruo@yahoo.com>
Commit: Po Lu <luangruo@yahoo.com>
Fix bug#57476
* src/xterm.c (handle_one_xevent): Don't reset valuators on certain
crossing events, for the benefit of xfwm4. (bug#57476)
---
src/xterm.c | 31 ++++++++++++++++++++++++++++---
1 file changed, 28 insertions(+), 3 deletions(-)
diff --git a/src/xterm.c b/src/xterm.c
index e0a8e13b24..3c05bc7807 100644
--- a/src/xterm.c
+++ b/src/xterm.c
@@ -20771,8 +20771,20 @@ handle_one_xevent (struct x_display_info *dpyinfo,
any = x_any_window_to_frame (dpyinfo, enter->event);
#ifdef HAVE_XINPUT2_1
- xi_reset_scroll_valuators_for_device_id (dpyinfo, enter->deviceid,
- true);
+ /* xfwm4 selects for button events on the frame window,
+ resulting in passive grabs being generated along with
+ the delivery of emulated button events; this then
+ interferes with scrolling, since device valuators
+ will constantly be reset as the crossing events
+ related to those grabs arrive. The only way to
+ remedy this is to never reset scroll valuators on a
+ grab-related crossing event. (bug#57476) */
+ if (enter->mode != XINotifyUngrab
+ && enter->mode != XINotifyGrab
+ && enter->mode != XINotifyPassiveGrab
+ && enter->mode != XINotifyPassiveUngrab)
+ xi_reset_scroll_valuators_for_device_id (dpyinfo,
enter->deviceid,
+ true);
#endif
{
@@ -20888,7 +20900,20 @@ handle_one_xevent (struct x_display_info *dpyinfo,
moves out of a frame (and not into one of its
children, which we know about). */
#ifdef HAVE_XINPUT2_1
- if (leave->detail != XINotifyInferior && any)
+ if (leave->detail != XINotifyInferior && any
+ /* xfwm4 selects for button events on the frame
+ window, resulting in passive grabs being
+ generated along with the delivery of emulated
+ button events; this then interferes with
+ scrolling, since device valuators will constantly
+ be reset as the crossing events related to those
+ grabs arrive. The only way to remedy this is to
+ never reset scroll valuators on a grab-related
+ crossing event. (bug#57476) */
+ && leave->mode != XINotifyUngrab
+ && leave->mode != XINotifyGrab
+ && leave->mode != XINotifyPassiveUngrab
+ && leave->mode != XINotifyPassiveGrab)
xi_reset_scroll_valuators_for_device_id (dpyinfo,
leave->deviceid,
false);
#endif