X-Git-Url: https://jasonwoof.com/gitweb/?a=blobdiff_plain;f=event.c;h=a8095116e638f3bf6b6a234df411ebde49836dc1;hb=f8181f64e2ba4fca4e85036c48cf90a2151794fc;hp=72595b293d31403625229ae51b8cf49eb10d4585;hpb=629647dfee4251fc4856b70658dff35cf5634057;p=dwm.git diff --git a/event.c b/event.c index 72595b2..a809511 100644 --- a/event.c +++ b/event.c @@ -1,4 +1,4 @@ -/* (C)opyright MMVI Anselm R. Garbe +/* (C)opyright MMVI-MMVII Anselm R. Garbe * See LICENSE file for license details. */ #include "dwm.h" @@ -131,8 +131,20 @@ buttonpress(XEvent *e) { return; } } - if((ev->x < x + bmw) && (ev->button == Button1)) - togglemode(NULL); + if(ev->x < x + bmw) + switch(ev->button) { + case Button1: + togglemode(NULL); + break; + case Button4: + a.i = 1; + incnmaster(&a); + break; + case Button5: + a.i = -1; + incnmaster(&a); + break; + } } else if((c = getclient(ev->window))) { focus(c); @@ -184,7 +196,7 @@ configurerequest(XEvent *e) { if(c->isfloat) { resize(c, False, TopLeft); if(!isvisible(c)) - ban(c); + XMoveWindow(dpy, c->win, c->x + 2 * sw, c->y); } else arrange(); @@ -218,12 +230,11 @@ enternotify(XEvent *e) { if(ev->mode != NotifyNormal || ev->detail == NotifyInferior) return; - if(((c = getclient(ev->window)) || (c = getctitle(ev->window))) && isvisible(c)) + if((c = getclient(ev->window)) && isvisible(c)) focus(c); else if(ev->window == root) { issel = True; XSetInputFocus(dpy, root, RevertToPointerRoot, CurrentTime); - drawall(); } } @@ -235,8 +246,6 @@ expose(XEvent *e) { if(ev->count == 0) { if(barwin == ev->window) drawstatus(); - else if((c = getctitle(ev->window))) - drawtitle(c); } } @@ -262,10 +271,8 @@ static void leavenotify(XEvent *e) { XCrossingEvent *ev = &e->xcrossing; - if((ev->window == root) && !ev->same_screen) { + if((ev->window == root) && !ev->same_screen) issel = False; - drawall(); - } } static void @@ -314,13 +321,13 @@ propertynotify(XEvent *e) { arrange(); break; case XA_WM_NORMAL_HINTS: - updatesize(c); + updatesizehints(c); break; } if(ev->atom == XA_WM_NAME || ev->atom == netatom[NetWMName]) { updatetitle(c); - resizetitle(c); - drawtitle(c); + if(c == sel) + drawstatus(); } } }