X-Git-Url: https://jasonwoof.com/gitweb/?a=blobdiff_plain;f=event.c;h=25ed6faad4054962bec61348a59795d925d757c5;hb=0680c76a6fca2a285e2a561192774906d121e2c1;hp=2e4f62ee74277de12b1babc8d2e2c9fe4aae0b3a;hpb=c225e1afc23e6862f9864bad3b7b11399dda36a1;p=dwm.git diff --git a/event.c b/event.c index 2e4f62e..25ed6fa 100644 --- a/event.c +++ b/event.c @@ -114,32 +114,30 @@ buttonpress(XEvent *e) } break; case Button4: - viewnext(&a); + viewprev(&a); break; case Button5: - viewprev(&a); + viewnext(&a); break; } } else if((c = getclient(ev->window))) { + higher(c); focus(c); switch(ev->button) { default: break; case Button1: - if(!c->ismax && (arrange == dofloat || c->isfloat)) { - higher(c); + if(!c->ismax && (arrange == dofloat || c->isfloat)) movemouse(c); - } break; case Button2: - lower(c); + if(!c->ismax && arrange != dofloat && !c->isfloat) + zoom(NULL); break; case Button3: - if(!c->ismax && (arrange == dofloat || c->isfloat)) { - higher(c); + if(!c->ismax && (arrange == dofloat || c->isfloat)) resizemouse(c); - } break; } } @@ -223,13 +221,16 @@ enternotify(XEvent *e) Client *c; XCrossingEvent *ev = &e->xcrossing; - if(ev->detail == NotifyInferior) + if(ev->mode != NotifyNormal || ev->detail == NotifyInferior) return; if((c = getclient(ev->window)) || (c = getctitle(ev->window))) focus(c); - else if(ev->window == root) + else if(ev->window == root) { issel = True; + XSetInputFocus(dpy, root, RevertToPointerRoot, CurrentTime); + drawall(); + } } static void @@ -269,8 +270,10 @@ leavenotify(XEvent *e) { XCrossingEvent *ev = &e->xcrossing; - if((ev->window == root) && !ev->same_screen) - issel = True; + if((ev->window == root) && !ev->same_screen) { + issel = False; + drawall(); + } } static void