updated client_grab

This commit is contained in:
Anselm R. Garbe 2006-04-27 18:32:37 +02:00
parent e204c6f5eb
commit 623147ed85
3 changed files with 19 additions and 7 deletions

View File

@ -99,6 +99,18 @@ set_client_state(Client * c, int state)
PropModeReplace, (unsigned char *) data, 2);
}
void
update_client_grab(Client *c, Bool is_sel)
{
if(is_sel) {
ungrab_mouse(c->framewin, AnyModifier, AnyButton);
grab_mouse(c->framewin, def.mod, Button1);
grab_mouse(c->framewin, def.mod, Button3);
}
else
grab_mouse(c->framewin, AnyModifier, Button1);
}
void
focus_client(Client *c, Bool restack)
{
@ -114,6 +126,11 @@ focus_client(Client *c, Bool restack)
draw_client(old);
if(restack)
restack_view(v);
else {
if(old)
update_client_grab(old, False);
update_client_grab(c, True);
}
XSetInputFocus(dpy, c->win, RevertToPointerRoot, CurrentTime);
draw_client(c);

View File

@ -256,13 +256,7 @@ restack_view(View *v)
wins[n++] = a->frame.data[a->sel]->client->framewin;
for(j = a->frame.size - 1; j >= 0; j--) {
Client *c = a->frame.data[j]->client;
if((v->sel == i) && (a->sel == j)) {
ungrab_mouse(c->framewin, AnyModifier, AnyButton);
grab_mouse(c->framewin, def.mod, Button1);
grab_mouse(c->framewin, def.mod, Button3);
}
else
grab_mouse(c->framewin, AnyModifier, Button1);
update_client_grab(c, (v->sel == i) && (a->sel == j));
if(j == a->sel)
continue;
wins[n++] = c->framewin;

View File

@ -232,6 +232,7 @@ Client *sel_client();
int idx_of_client_id(unsigned short id);
Client *client_of_win(Window w);
void draw_clients();
void update_client_grab(Client *c, Bool is_sel);
/* column.c */
void arrange_column(Area *a, Bool dirty);