X-Git-Url: https://git.danieliu.xyz/?a=blobdiff_plain;f=event.c;h=25ed6faad4054962bec61348a59795d925d757c5;hb=9d39da645277561be4ccec5ce431ef3fd6469c7c;hp=b6beed561f88985ed0a15d5a31ab802c12de2007;hpb=c53f0fca912e05cddcfbf79d99678b16d183c67d;p=dwm.git diff --git a/event.c b/event.c index b6beed5..25ed6fa 100644 --- a/event.c +++ b/event.c @@ -114,34 +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); - } - else - zoom(NULL); 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; } } @@ -225,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 @@ -271,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