X-Git-Url: https://git.armaanb.net/?p=slock.git;a=blobdiff_plain;f=slock.c;h=700acfb4f5c969adc503fbabfb2b9ffd58932f0b;hp=4d7f06fe9a8fc4dc3b6904fc8231c065614a17d8;hb=0ff0d9f7a7156a0e0b41d5b208ae5625e3a15dab;hpb=c96e725df0c449abb5f1f6a3b604f64fa69c4756 diff --git a/slock.c b/slock.c index 4d7f06f..700acfb 100644 --- a/slock.c +++ b/slock.c @@ -31,8 +31,6 @@ enum { NUMCOLS }; -#include "config.h" - struct lock { int screen; Window root, win; @@ -46,6 +44,8 @@ struct xrandr { int errbase; }; +#include "config.h" + static void die(const char *errstr, ...) { @@ -166,7 +166,7 @@ readpw(Display *dpy, struct xrandr *rr, struct lock **locks, int nscreens, running = !!strcmp(inputhash, hash); if (running) { XBell(dpy, 100); - failure = True; + failure = 1; } explicit_bzero(&passwd, sizeof(passwd)); len = 0; @@ -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++)