[hackers] [wmii] Fixed client grabs

From: Kris Maglione <jg_AT_suckless.org>
Date: Sat Feb 10 03:33:43 2007

changeset: 1821:12b661434242
tag: tip
user: Kris Maglione <jg_AT_suckless.org>
date: Fri Feb 09 21:29:21 2007 -0500
summary: Fixed client grabs

diff -r d25576a3ebc0 -r 12b661434242 area.c
--- a/area.c Fri Feb 09 21:19:26 2007 -0500
+++ b/area.c Fri Feb 09 21:29:21 2007 -0500
@@ -253,6 +253,8 @@ attach_to_area(Area *a, Frame *f, Bool s
                 arrange_column(a, False);
         }else /* floating */
                 place_client(a, c);
+
+ update_client_grab(f->client);
 }
 
 void
diff -r d25576a3ebc0 -r 12b661434242 client.c
--- a/client.c Fri Feb 09 21:19:26 2007 -0500
+++ b/client.c Fri Feb 09 21:29:21 2007 -0500
@@ -52,7 +52,6 @@ create_client(Window w, XWindowAttribute
                         DefaultVisual(blz.dpy, blz.screen),
                         CWOverrideRedirect | CWBackPixmap | CWEventMask, &fwa);
         c->gc = XCreateGC(blz.dpy, c->framewin, 0, 0);
- update_client_grab(c);
         XSync(blz.dpy, False);
         for(t=&client; *t; t=&(*t)->next);
         c->next = *t; /* *t == nil */
@@ -144,7 +143,9 @@ update_client_name(Client *c) {
 }
 void
 update_client_grab(Client *c) {
- if(c == sel_client()) {
+ Frame *f;
+ f = c->sel;
+ if(!f->area->floating || f == f->area->stack) {
                 XUngrabButton(blz.dpy, AnyButton, AnyModifier, c->framewin);
                 grab_button(c->framewin, Button1, def.mod);
                 grab_button(c->framewin, Button3, def.mod);
@@ -207,11 +208,8 @@ focus_client(Client *c, Bool restack) {
                 else
                         write_event("FocusFloating\n");
         }
- if(c != old) {
- update_client_grab(c);
- update_client_grab(old);
+ if(c != old)
                 write_event("ClientFocus 0x%x\n", c->win);
- }
 }
 
 void
diff -r d25576a3ebc0 -r 12b661434242 frame.c
--- a/frame.c Fri Feb 09 21:19:26 2007 -0500
+++ b/frame.c Fri Feb 09 21:29:21 2007 -0500
@@ -108,6 +108,7 @@ frame_to_top(Frame *f) {
         *tf = f->snext;
         f->snext = a->stack;
         a->stack = f;
+ update_client_grab(f->client);
         return True;
 }
 
diff -r d25576a3ebc0 -r 12b661434242 view.c
--- a/view.c Fri Feb 09 21:19:26 2007 -0500
+++ b/view.c Fri Feb 09 21:29:21 2007 -0500
@@ -115,9 +115,10 @@ focus_view(WMScreen *s, View *v) {
         /* gives all(!) clients proper geometry (for use of different tags) */
         for(c=client; c; c=c->next)
                 if((f = c->sel)) {
- if(f->view == v)
+ if(f->view == v) {
                                 resize_client(c, &f->rect);
- else
+ update_client_grab(c);
+ }else
                                 XMoveWindow(blz.dpy, c->framewin, 2 * s->rect.width + f->rect.x,
                                                 f->rect.y);
                 }
Received on Sat Feb 10 2007 - 03:33:43 UTC

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