From bb0317442b4d62108ca40cc396f5ced467c55f25 Mon Sep 17 00:00:00 2001 From: Po Lu Date: Fri, 27 May 2022 10:34:04 +0800 Subject: [PATCH] Fix XI scroll valuator reset on X Toolkit builds * src/xterm.c (handle_one_xevent): Reset valuators on XI_Leave if leave->event is an edit widget as well. --- src/xterm.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/xterm.c b/src/xterm.c index 5964a8bb483..4f264ab2a86 100644 --- a/src/xterm.c +++ b/src/xterm.c @@ -17841,6 +17841,16 @@ handle_one_xevent (struct x_display_info *dpyinfo, masks are set on the frame widget's window. */ f = x_window_to_frame (dpyinfo, leave->event); + /* Also do this again here, since the test for `any' + above may not have found a frame, as that usually + just looks up a top window on Xt builds. */ + +#ifdef HAVE_XINPUT2_1 + if (leave->detail != XINotifyInferior && f) + xi_reset_scroll_valuators_for_device_id (dpyinfo, + leave->deviceid, false); +#endif + if (!f) f = x_top_window_to_frame (dpyinfo, leave->event); #endif -- 2.39.2