Fix no-focus-on-map on X without GTK
* src/xterm.c [!USE_GTK] (x_update_frame_user_time_window): When replacing _NET_WM_USER_TIME with a new _NET_WM_USER_TIME_WINDOW and the frame has requested no-focus-on-map, ensure _NET_WM_USER_TIME is zero also on the new _NET_WM_USER_TIME_WINDOW. (x_make_frame_visible) [!USE_GTK]: Don't overwrite _NET_WM_USER_TIME before mapping a frame that has requested no-focus-on-map, and whose _NET_WM_USER_TIME should thus remain zero (bug#80525).
This commit is contained in:
17
src/xterm.c
17
src/xterm.c
@@ -8283,6 +8283,14 @@ x_update_frame_user_time_window (struct frame *f)
|
||||
output->user_time_window
|
||||
= x_create_special_window (dpyinfo, FRAME_X_WINDOW (f));
|
||||
|
||||
if (FRAME_NO_FOCUS_ON_MAP (f))
|
||||
/* If the user time is zero, which is the case with
|
||||
`no-focus-on-map', then preserve that value by copying
|
||||
it to the new user time window. */
|
||||
XChangeProperty (dpyinfo->display, output->user_time_window,
|
||||
dpyinfo->Xatom_net_wm_user_time, XA_CARDINAL, 32,
|
||||
PropModeReplace, (unsigned char *) &(Time) {0}, 1);
|
||||
|
||||
XDeleteProperty (dpyinfo->display, FRAME_OUTER_WINDOW (f),
|
||||
dpyinfo->Xatom_net_wm_user_time);
|
||||
XChangeProperty (dpyinfo->display, FRAME_OUTER_WINDOW (f),
|
||||
@@ -29186,14 +29194,15 @@ x_make_frame_visible (struct frame *f)
|
||||
remember if it can leave `user_time_window' unset or not. */
|
||||
if (output->user_time_window != None)
|
||||
{
|
||||
if (dpyinfo->last_user_time)
|
||||
if (!dpyinfo->last_user_time)
|
||||
XDeleteProperty (dpyinfo->display, output->user_time_window,
|
||||
dpyinfo->Xatom_net_wm_user_time);
|
||||
/* Don't overwrite a zero user time for `no-focus-on-map'. */
|
||||
else if (!FRAME_NO_FOCUS_ON_MAP (f))
|
||||
XChangeProperty (dpyinfo->display, output->user_time_window,
|
||||
dpyinfo->Xatom_net_wm_user_time,
|
||||
XA_CARDINAL, 32, PropModeReplace,
|
||||
(unsigned char *) &dpyinfo->last_user_time, 1);
|
||||
else
|
||||
XDeleteProperty (dpyinfo->display, output->user_time_window,
|
||||
dpyinfo->Xatom_net_wm_user_time);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
Reference in New Issue
Block a user