aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorPo Lu2022-10-11 19:55:14 +0800
committerPo Lu2022-10-11 19:56:05 +0800
commit61b6da5acef2d550022c664e628346539ba1852f (patch)
tree5fed0883cd2fb94298753881bde33dbf625ff7d9 /src
parent48df8bbb1fd55e363c85e968de3719c9ec5150a7 (diff)
downloademacs-61b6da5acef2d550022c664e628346539ba1852f.tar.gz
emacs-61b6da5acef2d550022c664e628346539ba1852f.zip
Also avoid setting _NET_WM_USER_TIME on crossing
* src/xterm.c (handle_one_xevent): Stop setting user time prop on crossing events.
Diffstat (limited to 'src')
-rw-r--r--src/xterm.c20
1 files changed, 11 insertions, 9 deletions
diff --git a/src/xterm.c b/src/xterm.c
index 21207a31461..9c34fce7c5b 100644
--- a/src/xterm.c
+++ b/src/xterm.c
@@ -7592,17 +7592,19 @@ static void x_check_font (struct frame *, struct font *);
7592 ridiculously large value, and this way a more reasonable timestamp 7592 ridiculously large value, and this way a more reasonable timestamp
7593 can be obtained upon the next event. 7593 can be obtained upon the next event.
7594 7594
7595 Alternatively, the server time could've overflowed.
7596
7595 SET_PROPERTY specifies whether or not to change the user time 7597 SET_PROPERTY specifies whether or not to change the user time
7596 property for the active frame. The important thing is to not set 7598 property for the active frame. The important thing is to not set
7597 the last user time upon leave events; on Metacity and GNOME Shell, 7599 the last user time upon leave events; on Metacity and GNOME Shell,
7598 mapping a new frame on top of the old frame potentially causes 7600 mapping a new frame on top of the old frame potentially causes
7599 LeaveNotify or XI_Leave to be sent to the old frame if it contains 7601 crossing events to be sent to the old frame if it contains the
7600 the pointer, as the new frame will initially stack above the old 7602 pointer, as the new frame will initially stack above the old frame.
7601 frame. If _NET_WM_USER_TIME is changed at that point, then GNOME 7603 If _NET_WM_USER_TIME is changed at that point, then GNOME may get
7602 may get notified about the user time change on the old frame before 7604 notified about the user time change on the old frame before it
7603 it tries to focus the new frame, which will make it consider the 7605 tries to focus the new frame, which will make it consider the new
7604 new frame (whose user time property will not have been updated at 7606 frame (whose user time property will not have been updated at that
7605 that point, due to not being focused) as having been mapped 7607 point, due to not being focused) as having been mapped
7606 out-of-order, and lower the new frame, which is typically not what 7608 out-of-order, and lower the new frame, which is typically not what
7607 users want. */ 7609 users want. */
7608 7610
@@ -19567,7 +19569,7 @@ handle_one_xevent (struct x_display_info *dpyinfo,
19567 19569
19568 case EnterNotify: 19570 case EnterNotify:
19569 x_display_set_last_user_time (dpyinfo, event->xcrossing.time, 19571 x_display_set_last_user_time (dpyinfo, event->xcrossing.time,
19570 event->xcrossing.send_event, true); 19572 event->xcrossing.send_event, false);
19571 19573
19572#ifdef HAVE_XINPUT2 19574#ifdef HAVE_XINPUT2
19573 /* For whatever reason, the X server continues to deliver 19575 /* For whatever reason, the X server continues to deliver
@@ -21114,7 +21116,7 @@ handle_one_xevent (struct x_display_info *dpyinfo,
21114 ev.send_event = enter->send_event; 21116 ev.send_event = enter->send_event;
21115 21117
21116 x_display_set_last_user_time (dpyinfo, enter->time, 21118 x_display_set_last_user_time (dpyinfo, enter->time,
21117 enter->send_event, true); 21119 enter->send_event, false);
21118 21120
21119#ifdef USE_MOTIF 21121#ifdef USE_MOTIF
21120 use_copy = true; 21122 use_copy = true;