Finally fix the freezing bug, I hope

This commit is contained in:
Kris Maglione 2007-02-09 18:07:59 -05:00
parent dfaef7c3a7
commit 4ec78c508e
2 changed files with 7 additions and 13 deletions

View File

@ -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);

14
event.c
View File

@ -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