X-Git-Url: https://git.danieliu.xyz/?a=blobdiff_plain;f=dwm.c;h=e7804dc389796f195c306db8ef96e32acbc3ae36;hb=9a4d07d9de31c7bf3fba83c66d1a09d63848adfc;hp=bdef7555b7e9d10f4c00bed34126c4f42be51cd3;hpb=753e0e048e13fe7cbace7c07917d26081a483eba;p=dwm.git diff --git a/dwm.c b/dwm.c index bdef755..e7804dc 100644 --- a/dwm.c +++ b/dwm.c @@ -337,15 +337,14 @@ buttonpress(XEvent *e) { void checkotherwm(void) { otherwm = False; - XSetErrorHandler(xerrorstart); + xerrorxlib = XSetErrorHandler(xerrorstart); /* this causes an error if some other window manager is running */ XSelectInput(dpy, DefaultRootWindow(dpy), SubstructureRedirectMask); XSync(dpy, False); if(otherwm) die("dwm: another window manager is already running\n"); - XSetErrorHandler(NULL); - xerrorxlib = XSetErrorHandler(xerror); + XSetErrorHandler(xerror); XSync(dpy, False); } @@ -1056,9 +1055,9 @@ resize(Client *c, int x, int y, int w, int h, Bool sizehints) { /* adjust for aspect limits */ if(c->mina > 0 && c->maxa > 0) { - if(c->maxa < (float)(w / h)) + if(c->maxa < (float)w / h) w = h * c->maxa; - else if(c->mina < (float)(h / w)) + else if(c->mina < (float)h / w) h = w * c->mina; } @@ -1625,7 +1624,7 @@ updatesizehints(Client *c) { else c->maxa = c->mina = 0.0; c->isfixed = (c->maxw && c->minw && c->maxh && c->minh - && c->maxw == c->minw && c->maxh == c->minh); + && c->maxw == c->minw && c->maxh == c->minh); } void