Fixed client grabs

This commit is contained in:
Kris Maglione 2007-02-09 21:29:21 -05:00
parent 05d83dd294
commit ca4cffaeed
4 changed files with 10 additions and 8 deletions

2
area.c
View File

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

View File

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

View File

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

5
view.c
View File

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