From 8ffa8d334b7574d7d132852105e757af425d8a3d Mon Sep 17 00:00:00 2001 From: Derek Stevens Date: Mon, 4 Jan 2021 01:14:23 -0500 Subject: [PATCH] event.c/newwindow(): Use XGetRootWindowAttributes instead of client->screen to get desktop dimensions. This is needed to proprely size a keyboard-created window when using a smaller framebuffer size than the physical display. --- event.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/event.c b/event.c index d6f9425..6e1f493 100755 --- a/event.c +++ b/event.c @@ -271,6 +271,9 @@ newwindow(XCreateWindowEvent *e) { Client *c; ScreenInfo *s; + static XWindowAttributes ra; + XGetWindowAttributes(dpy, DefaultRootWindow(dpy), &ra); + /* we don't set curtime as nothing here uses it */ if(e->override_redirect) @@ -289,7 +292,7 @@ newwindow(XCreateWindowEvent *e) if (kbLaunch) { usleep(100000); - quickreshape(c, c->screen->width/5, c->screen->height/5, 3*c->screen->width/5, 3*c->screen->height/5); + quickreshape(c, ra.width/5, ra.height/5, 3*ra.width/5, 3*ra.height/5); kbLaunch = 0; } }