commit ca4cffaeedcf1788ee8048735b832c16a94c8d29
parent 05d83dd29476c78cfb78e6f42c242ce4b4fa384d
Author: Kris Maglione <jg@suckless.org>
Date: Fri, 9 Feb 2007 21:29:21 -0500
Fixed client grabs
Diffstat:
4 files changed, 10 insertions(+), 8 deletions(-)
diff --git a/area.c b/area.c
@@ -253,6 +253,8 @@ attach_to_area(Area *a, Frame *f, Bool send) {
arrange_column(a, False);
}else /* floating */
place_client(a, c);
+
+ update_client_grab(f->client);
}
void
diff --git a/client.c b/client.c
@@ -52,7 +52,6 @@ create_client(Window w, XWindowAttributes *wa) {
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 --git a/frame.c b/frame.c
@@ -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 --git a/view.c b/view.c
@@ -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);
}