X-Git-Url: https://jasonwoof.com/gitweb/?p=dwm.git;a=blobdiff_plain;f=event.c;h=e95991738919768a00d8664333bf47d7972e8ef3;hp=2df382181ebd71f9e063d36770d8f52c871bd9a1;hb=6651dd7fd9e8e95cfc6c472f1adfeff41735d798;hpb=6092aa977e9cc87bcf72713af8e7c698ddea4b56 diff --git a/event.c b/event.c index 2df3821..e959917 100644 --- a/event.c +++ b/event.c @@ -1,5 +1,4 @@ -/* - * (C)opyright MMVI Anselm R. Garbe +/* (C)opyright MMVI Anselm R. Garbe * See LICENSE file for license details. */ #include "dwm.h" @@ -64,7 +63,7 @@ resizemouse(Client *c) { ocx = c->x; ocy = c->y; if(XGrabPointer(dpy, root, False, MOUSEMASK, GrabModeAsync, GrabModeAsync, - None, cursor[CurResize], CurrentTime) != GrabSuccess) + None, cursor[CurResize], CurrentTime) != GrabSuccess) return; c->ismax = False; XWarpPointer(dpy, None, c->win, 0, 0, 0, 0, c->w, c->h); @@ -123,10 +122,8 @@ buttonpress(XEvent *e) { return; } } - if(ev->x < x + bmw) { - if(ev->button == Button1) - togglemode(NULL); - } + if((ev->x < x + bmw) && (ev->button == Button1)) + togglemode(NULL); } else if((c = getclient(ev->window))) { focus(c); @@ -176,8 +173,11 @@ configurerequest(XEvent *e) { else configure(c); XSync(dpy, False); - if(c->isfloat) + if(c->isfloat) { resize(c, False, TopLeft); + if(!isvisible(c)) + ban(c); + } else arrange(NULL); } @@ -210,7 +210,6 @@ enternotify(XEvent *e) { if(ev->mode != NotifyNormal || ev->detail == NotifyInferior) return; - if(((c = getclient(ev->window)) || (c = getctitle(ev->window))) && isvisible(c)) focus(c); else if(ev->window == root) { @@ -278,13 +277,11 @@ maprequest(XEvent *e) { if(!XGetWindowAttributes(dpy, ev->window, &wa)) return; - if(wa.override_redirect) { XSelectInput(dpy, ev->window, (StructureNotifyMask | PropertyChangeMask)); return; } - if(!getclient(ev->window)) manage(ev->window, &wa); } @@ -297,7 +294,6 @@ propertynotify(XEvent *e) { if(ev->state == PropertyDelete) return; /* ignore */ - if((c = getclient(ev->window))) { if(ev->atom == wmatom[WMProtocols]) { c->proto = getproto(c->win);