summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKim Woelders <kim@woelders.dk>2022-03-31 06:41:32 +0200
committerN-R-K <79544946+N-R-K@users.noreply.github.com>2022-03-31 16:52:50 +0200
commit14e9c34ecc399d7b96151f79f1775c8cb5d67a86 (patch)
treeb0deccb184020739ae39b56fe3ba19b1db7e6ec4
parente9468d3d3670ceddbababe312a3523f473159306 (diff)
downloadnsxiv-14e9c34ecc399d7b96151f79f1775c8cb5d67a86.tar.zst
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.
-rw-r--r--window.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/window.c b/window.c
index 3c55133..b4b9c41 100644
--- a/window.c
+++ b/window.c
@@ -309,6 +309,12 @@ void win_open(win_t *win)
hints.initial_state = NormalState;
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->buf.w = e->scrw;
@@ -320,9 +326,6 @@ void win_open(win_t *win)
XSetWindowBackgroundPixmap(e->dpy, win->xwin, win->buf.pm);
XMapWindow(e->dpy, win->xwin);
XFlush(e->dpy);
-
- if (options->fullscreen)
- win_toggle_fullscreen(win);
}
CLEANUP void win_close(win_t *win)