mirror of
https://github.com/0intro/wmii
synced 2025-02-09 19:04:19 +03:00
updated client_grab
This commit is contained in:
parent
e204c6f5eb
commit
623147ed85
@ -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);
|
||||
|
@ -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;
|
||||
|
@ -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);
|
||||
|
Loading…
x
Reference in New Issue
Block a user