]> git.eshelyaron.com Git - emacs.git/commitdiff
Only reset scroll valuators on real enter events
authorPo Lu <luangruo@yahoo.com>
Tue, 23 Nov 2021 03:08:45 +0000 (11:08 +0800)
committerPo Lu <luangruo@yahoo.com>
Tue, 23 Nov 2021 03:08:45 +0000 (11:08 +0800)
* src/xterm.c (handle_one_xevent): Test event detail and mode
before resetting scroll valuators.

src/xterm.c

index 11e7e602c09c0f0815d0baabe597f5b91693566a..bbfd3b0e82bc50399c6bc1b4e8874479fcb00b07 100644 (file)
@@ -9870,7 +9870,12 @@ handle_one_xevent (struct x_display_info *dpyinfo,
 
            x_display_set_last_user_time (dpyinfo, xi_event->time);
            x_detect_focus_change (dpyinfo, any, event, &inev.ie);
-           xi_reset_scroll_valuators_for_device_id (dpyinfo, enter->deviceid);
+
+           if (enter->detail != XINotifyInferior
+               && enter->mode != XINotifyPassiveUngrab
+               && enter->mode != XINotifyUngrab && any)
+             xi_reset_scroll_valuators_for_device_id (dpyinfo, enter->deviceid);
+
            f = any;
 
            if (f && x_mouse_click_focus_ignore_position)
@@ -9895,7 +9900,6 @@ handle_one_xevent (struct x_display_info *dpyinfo,
 
            x_display_set_last_user_time (dpyinfo, xi_event->time);
            x_detect_focus_change (dpyinfo, any, event, &inev.ie);
-           xi_reset_scroll_valuators_for_device_id (dpyinfo, leave->deviceid);
 
            f = x_top_window_to_frame (dpyinfo, leave->event);
            if (f)