Improve starting in fullscreen mode

Instead of effectively first mapping the window at regular size and then
fullscreening it, tell the WM to map the window at fullscreen size by
setting _NET_WM_STATE_FULLSCREEN before mapping the window.
This commit is contained in:
Kim Woelders 2022-03-31 06:41:32 +02:00 committed by N-R-K
parent e9468d3d36
commit 14e9c34ecc

View File

@ -309,6 +309,12 @@ void win_open(win_t *win)
hints.initial_state = NormalState; hints.initial_state = NormalState;
XSetWMHints(win->env.dpy, win->xwin, &hints); XSetWMHints(win->env.dpy, win->xwin, &hints);
if (options->fullscreen) {
XChangeProperty(e->dpy, win->xwin, atoms[ATOM__NET_WM_STATE],
XA_ATOM, 32, PropModeReplace,
(unsigned char *) &atoms[ATOM__NET_WM_STATE_FULLSCREEN], 1);
}
win->h -= win->bar.h; win->h -= win->bar.h;
win->buf.w = e->scrw; win->buf.w = e->scrw;
@ -320,9 +326,6 @@ void win_open(win_t *win)
XSetWindowBackgroundPixmap(e->dpy, win->xwin, win->buf.pm); XSetWindowBackgroundPixmap(e->dpy, win->xwin, win->buf.pm);
XMapWindow(e->dpy, win->xwin); XMapWindow(e->dpy, win->xwin);
XFlush(e->dpy); XFlush(e->dpy);
if (options->fullscreen)
win_toggle_fullscreen(win);
} }
CLEANUP void win_close(win_t *win) CLEANUP void win_close(win_t *win)