X-Git-Url: https://git.danieliu.xyz/?a=blobdiff_plain;f=slock.c;h=700acfb4f5c969adc503fbabfb2b9ffd58932f0b;hb=0ff0d9f7a7156a0e0b41d5b208ae5625e3a15dab;hp=d2f08862453615c3131332273fbd1d0187f4195c;hpb=7d31ff65a0b0388f788ca6932c815ab29e5fb10f;p=slock.git diff --git a/slock.c b/slock.c index d2f0886..700acfb 100644 --- a/slock.c +++ b/slock.c @@ -201,9 +201,15 @@ readpw(Display *dpy, struct xrandr *rr, struct lock **locks, int nscreens, rre = (XRRScreenChangeNotifyEvent*)&ev; for (screen = 0; screen < nscreens; screen++) { if (locks[screen]->win == rre->window) { - XResizeWindow(dpy, locks[screen]->win, - rre->width, rre->height); + if (rre->rotation == RR_Rotate_90 || + rre->rotation == RR_Rotate_270) + XResizeWindow(dpy, locks[screen]->win, + rre->height, rre->width); + else + XResizeWindow(dpy, locks[screen]->win, + rre->width, rre->height); XClearWindow(dpy, locks[screen]->win); + break; } } } else for (screen = 0; screen < nscreens; screen++)