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.

This commit is contained in:
Iris Lightshard 2021-01-04 01:14:23 -05:00
parent 2da43562b5
commit 8ffa8d334b
Signed by: Iris Lightshard
GPG key ID: 3B7FBC22144E6398

View file

@ -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;
}
}