diff --git a/client.c b/client.c index b2d1f9bb..cb2ca89c 100644 --- a/client.c +++ b/client.c @@ -51,10 +51,8 @@ create_client(Window w, XWindowAttributes *wa) { DefaultDepth(blz.dpy, blz.screen), CopyFromParent, DefaultVisual(blz.dpy, blz.screen), CWOverrideRedirect | CWBackPixmap | CWEventMask, &fwa); - XGrabButton(blz.dpy, Button1, AnyModifier, c->framewin, True, ButtonPressMask, - GrabModeSync, GrabModeAsync, None, None); - XGrabButton(blz.dpy, Button3, AnyModifier, c->framewin, True, ButtonPressMask, - GrabModeSync, GrabModeAsync, None, None); + XGrabButton(blz.dpy, AnyButton, AnyModifier, c->framewin, True, ButtonMask, + GrabModeSync, GrabModeSync, None, None); c->gc = XCreateGC(blz.dpy, c->framewin, 0, 0); XSync(blz.dpy, False); for(t=&client; *t; t=&(*t)->next); diff --git a/event.c b/event.c index 922d0924..0c20c66e 100644 --- a/event.c +++ b/event.c @@ -48,7 +48,6 @@ buttonpress(XEvent *e) { ev = &e->xbutton; if((f = frame_of_win(ev->window))) { inclient = (ev->subwindow == f->client->win); - ev->state &= valid_mask; if((ev->state & def.mod) == def.mod) { switch(ev->button) { case Button1: @@ -62,15 +61,12 @@ buttonpress(XEvent *e) { quadofcoord(&f->client->rect, ev->x, ev->y)); frame_to_top(f); focus(f->client, True); - default: - XAllowEvents(blz.dpy, AsyncPointer, ev->time); - break; + break; + default: break; + XAllowEvents(blz.dpy, ReplayPointer, CurrentTime); } }else{ - if(inclient) - XAllowEvents(blz.dpy, ReplayPointer, ev->time); - else - XAllowEvents(blz.dpy, AsyncPointer, ev->time); + XAllowEvents(blz.dpy, ReplayPointer, CurrentTime); if(ev->button == Button1) { if(frame_to_top(f) || f->client != sel_client()) focus(f->client, True); @@ -79,7 +75,7 @@ buttonpress(XEvent *e) { } } }else - XAllowEvents(blz.dpy, AsyncPointer, ev->time); + XAllowEvents(blz.dpy, ReplayPointer, CurrentTime); } static void