commit 4ec78c508e66efe610ef7bf2493d6fdb59a93efd
parent dfaef7c3a765e4d17eef4c998847bcd8fce29a22
Author: Kris Maglione <jg@suckless.org>
Date: Fri, 9 Feb 2007 18:07:59 -0500
Finally fix the freezing bug, I hope
Diffstat:
2 files changed, 7 insertions(+), 13 deletions(-)
diff --git 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
@@ -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