[hackers] [wmii] Another go at preventing freeze

From: Kris Maglione <jg_AT_suckless.org>
Date: Fri Feb 09 20:08:02 2007

changeset: 1811:01cbfde535d4
tag: tip
user: Kris Maglione <jg_AT_suckless.org>
date: Fri Feb 09 14:06:24 2007 -0500
summary: Another go at preventing freeze

diff -r 7ca6539ac4b3 -r 01cbfde535d4 client.c
--- a/client.c Fri Feb 09 13:21:07 2007 -0500
+++ b/client.c Fri Feb 09 14:06:24 2007 -0500
@@ -51,7 +51,9 @@ create_client(Window w, XWindowAttribute
                         DefaultDepth(blz.dpy, blz.screen), CopyFromParent,
                         DefaultVisual(blz.dpy, blz.screen),
                         CWOverrideRedirect | CWBackPixmap | CWEventMask, &fwa);
- XGrabButton(blz.dpy, AnyButton, AnyModifier, c->framewin, False, ButtonMask,
+ XGrabButton(blz.dpy, Button1, AnyModifier, c->framewin, False, ButtonMask,
+ GrabModeSync, GrabModeSync, None, None);
+ XGrabButton(blz.dpy, Button3, AnyModifier, c->framewin, False, ButtonMask,
                         GrabModeSync, GrabModeSync, None, None);
         c->gc = XCreateGC(blz.dpy, c->framewin, 0, 0);
         XSync(blz.dpy, False);
diff -r 7ca6539ac4b3 -r 01cbfde535d4 event.c
--- a/event.c Fri Feb 09 13:21:07 2007 -0500
+++ b/event.c Fri Feb 09 14:06:24 2007 -0500
@@ -35,8 +35,10 @@ buttonrelease(XEvent *e) {
                                 return;
                         }
         }
- else if((f = frame_of_win(ev->window)))
+ else if((f = frame_of_win(ev->window))) {
                 write_event("ClientClick 0x%x %d\n", f->client->win, ev->button);
+ XAllowEvents(blz.dpy, ReplayPointer, ev->time);
+ }
 }
 
 static void
@@ -73,8 +75,7 @@ buttonpress(XEvent *e) {
                         }
                         XAllowEvents(blz.dpy, ReplayPointer, ev->time);
                 }
- }else
- XAllowEvents(blz.dpy, ReplayPointer, ev->time);
+ }
         XSync(blz.dpy, False);
 }
 
Received on Fri Feb 09 2007 - 20:08:02 UTC

This archive was generated by hypermail 2.2.0 : Sun Jul 13 2008 - 15:55:06 UTC