Reduce code duplication when setting user time window
* src/xterm.c (x_make_frame_visible): Use `x_update_frame_user_time_window'.
This commit is contained in:
parent
c0c538b392
commit
5e567af8e0
1 changed files with 12 additions and 47 deletions
59
src/xterm.c
59
src/xterm.c
|
@ -24795,56 +24795,21 @@ x_make_frame_visible (struct frame *f)
|
|||
|
||||
#ifndef USE_GTK
|
||||
output = FRAME_X_OUTPUT (f);
|
||||
x_update_frame_user_time_window (f);
|
||||
|
||||
if (!x_wm_supports (f, dpyinfo->Xatom_net_wm_user_time_window))
|
||||
/* It's been a while since I wrote that code... I don't
|
||||
remember if it can leave `user_time_window' unset or not. */
|
||||
if (output->user_time_window != None)
|
||||
{
|
||||
if (output->user_time_window == None)
|
||||
output->user_time_window = FRAME_OUTER_WINDOW (f);
|
||||
else if (output->user_time_window != FRAME_OUTER_WINDOW (f))
|
||||
{
|
||||
XDestroyWindow (dpyinfo->display,
|
||||
output->user_time_window);
|
||||
XDeleteProperty (dpyinfo->display,
|
||||
FRAME_OUTER_WINDOW (f),
|
||||
dpyinfo->Xatom_net_wm_user_time_window);
|
||||
output->user_time_window = FRAME_OUTER_WINDOW (f);
|
||||
}
|
||||
if (dpyinfo->last_user_time)
|
||||
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);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (output->user_time_window == FRAME_OUTER_WINDOW (f)
|
||||
|| output->user_time_window == None)
|
||||
{
|
||||
XSetWindowAttributes attrs;
|
||||
memset (&attrs, 0, sizeof attrs);
|
||||
|
||||
output->user_time_window
|
||||
= XCreateWindow (dpyinfo->display, FRAME_X_WINDOW (f),
|
||||
-1, -1, 1, 1, 0, 0, InputOnly,
|
||||
CopyFromParent, 0, &attrs);
|
||||
|
||||
XDeleteProperty (dpyinfo->display,
|
||||
FRAME_OUTER_WINDOW (f),
|
||||
dpyinfo->Xatom_net_wm_user_time);
|
||||
XChangeProperty (dpyinfo->display,
|
||||
FRAME_OUTER_WINDOW (f),
|
||||
dpyinfo->Xatom_net_wm_user_time_window,
|
||||
XA_WINDOW, 32, PropModeReplace,
|
||||
(unsigned char *) &output->user_time_window,
|
||||
1);
|
||||
}
|
||||
}
|
||||
|
||||
if (dpyinfo->last_user_time)
|
||||
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
|
||||
|
||||
f->output_data.x->asked_for_visible = true;
|
||||
|
|
Loading…
Add table
Reference in a new issue