Krolyxon
Commit 14e9c34

Branches

Refs →

nsxiv14e9c34

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.
Author
Kim Woelders
Date
2022-03-31 06:41 +0200
Committer
N-R-K · 2022-03-31 14:52 +0000
Parent
e9468d3
Commit
14e9c34ecc399d7b96151f79f1775c8cb5d67a86

+6 −3

1 file changed

  1. M window.c +6 −3
M window.c View
@@ -309,6 +309,12 @@ void win_open(win_t *win)
309309 hints.initial_state = NormalState;
310310 XSetWMHints(win->env.dpy, win->xwin, &hints);
311311
312+ if (options->fullscreen) {
313+ XChangeProperty(e->dpy, win->xwin, atoms[ATOM__NET_WM_STATE],
314+ XA_ATOM, 32, PropModeReplace,
315+ (unsigned char *) &atoms[ATOM__NET_WM_STATE_FULLSCREEN], 1);
316+ }
317+
312318 win->h -= win->bar.h;
313319
314320 win->buf.w = e->scrw;
@@ -320,9 +326,6 @@ void win_open(win_t *win)
320326 XSetWindowBackgroundPixmap(e->dpy, win->xwin, win->buf.pm);
321327 XMapWindow(e->dpy, win->xwin);
322328 XFlush(e->dpy);
323−
324− if (options->fullscreen)
325− win_toggle_fullscreen(win);
326329 }
327330
328331 CLEANUP void win_close(win_t *win)