]> git.eshelyaron.com Git - emacs.git/commitdiff
Fix setting user time upon scrolling self during DND
authorPo Lu <luangruo@yahoo.com>
Wed, 20 Jul 2022 01:41:43 +0000 (09:41 +0800)
committerPo Lu <luangruo@yahoo.com>
Wed, 20 Jul 2022 01:41:43 +0000 (09:41 +0800)
* src/xterm.c (handle_one_xevent): Set user time for emulated
scroll wheel events if Emacs ends up scrolled during DND.

src/xterm.c

index c9acc9055d5bfe2d4eb405e427b374a884173bea..86dc122f93321a08c80f35f587b94ee1c0ab8e0b 100644 (file)
@@ -20418,11 +20418,22 @@ handle_one_xevent (struct x_display_info *dpyinfo,
                      dnd_state = xi_convert_event_state (xev);
 
                      if (x_dnd_last_window_is_frame)
-                       x_dnd_note_self_wheel (dpyinfo,
-                                              x_dnd_last_seen_window,
-                                              xev->root_x, xev->root_y,
-                                              xev->detail, dnd_state,
-                                              xev->time);
+                       {
+#ifdef XI_PointerEmulated
+                         /* Set the last user time here even if this
+                            is an emulated button event, since
+                            something happened in response.  */
+
+                         if (xev->flags & XIPointerEmulated)
+                           x_display_set_last_user_time (dpyinfo, xev->time,
+                                                         xev->send_event);
+#endif
+                         x_dnd_note_self_wheel (dpyinfo,
+                                                x_dnd_last_seen_window,
+                                                xev->root_x, xev->root_y,
+                                                xev->detail, dnd_state,
+                                                xev->time);
+                       }
                      else
                        x_dnd_send_position (x_dnd_frame,
                                             x_dnd_last_seen_window,
@@ -20431,7 +20442,7 @@ handle_one_xevent (struct x_display_info *dpyinfo,
                                             xev->time, x_dnd_wanted_action,
                                             xev->detail, dnd_state);
 
-                     goto XI_OTHER;
+                     goto OTHER;
                    }
 
                  if (xev->evtype == XI_ButtonRelease)