]> git.eshelyaron.com Git - emacs.git/commitdiff
Also avoid setting _NET_WM_USER_TIME on crossing
authorPo Lu <luangruo@yahoo.com>
Tue, 11 Oct 2022 11:55:14 +0000 (19:55 +0800)
committerPo Lu <luangruo@yahoo.com>
Tue, 11 Oct 2022 11:56:05 +0000 (19:56 +0800)
* src/xterm.c (handle_one_xevent): Stop setting user time prop
on crossing events.

src/xterm.c

index 21207a31461fe47fada9024b822008524efbb7d5..9c34fce7c5bd7e1ba45982d50c780f7592015615 100644 (file)
@@ -7592,17 +7592,19 @@ static void x_check_font (struct frame *, struct font *);
    ridiculously large value, and this way a more reasonable timestamp
    can be obtained upon the next event.
 
+   Alternatively, the server time could've overflowed.
+
    SET_PROPERTY specifies whether or not to change the user time
    property for the active frame.  The important thing is to not set
    the last user time upon leave events; on Metacity and GNOME Shell,
    mapping a new frame on top of the old frame potentially causes
-   LeaveNotify or XI_Leave to be sent to the old frame if it contains
-   the pointer, as the new frame will initially stack above the old
-   frame.  If _NET_WM_USER_TIME is changed at that point, then GNOME
-   may get notified about the user time change on the old frame before
-   it tries to focus the new frame, which will make it consider the
-   new frame (whose user time property will not have been updated at
-   that point, due to not being focused) as having been mapped
+   crossing events to be sent to the old frame if it contains the
+   pointer, as the new frame will initially stack above the old frame.
+   If _NET_WM_USER_TIME is changed at that point, then GNOME may get
+   notified about the user time change on the old frame before it
+   tries to focus the new frame, which will make it consider the new
+   frame (whose user time property will not have been updated at that
+   point, due to not being focused) as having been mapped
    out-of-order, and lower the new frame, which is typically not what
    users want.  */
 
@@ -19567,7 +19569,7 @@ handle_one_xevent (struct x_display_info *dpyinfo,
 
     case EnterNotify:
       x_display_set_last_user_time (dpyinfo, event->xcrossing.time,
-                                   event->xcrossing.send_event, true);
+                                   event->xcrossing.send_event, false);
 
 #ifdef HAVE_XINPUT2
       /* For whatever reason, the X server continues to deliver
@@ -21114,7 +21116,7 @@ handle_one_xevent (struct x_display_info *dpyinfo,
              ev.send_event = enter->send_event;
 
              x_display_set_last_user_time (dpyinfo, enter->time,
-                                           enter->send_event, true);
+                                           enter->send_event, false);
 
 #ifdef USE_MOTIF
              use_copy = true;