mirror of
https://github.com/0intro/wmii
synced 2025-02-13 21:04:28 +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);
|
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
|
void
|
||||||
focus_client(Client *c, Bool restack)
|
focus_client(Client *c, Bool restack)
|
||||||
{
|
{
|
||||||
@ -114,6 +126,11 @@ focus_client(Client *c, Bool restack)
|
|||||||
draw_client(old);
|
draw_client(old);
|
||||||
if(restack)
|
if(restack)
|
||||||
restack_view(v);
|
restack_view(v);
|
||||||
|
else {
|
||||||
|
if(old)
|
||||||
|
update_client_grab(old, False);
|
||||||
|
update_client_grab(c, True);
|
||||||
|
}
|
||||||
|
|
||||||
XSetInputFocus(dpy, c->win, RevertToPointerRoot, CurrentTime);
|
XSetInputFocus(dpy, c->win, RevertToPointerRoot, CurrentTime);
|
||||||
draw_client(c);
|
draw_client(c);
|
||||||
|
@ -256,13 +256,7 @@ restack_view(View *v)
|
|||||||
wins[n++] = a->frame.data[a->sel]->client->framewin;
|
wins[n++] = a->frame.data[a->sel]->client->framewin;
|
||||||
for(j = a->frame.size - 1; j >= 0; j--) {
|
for(j = a->frame.size - 1; j >= 0; j--) {
|
||||||
Client *c = a->frame.data[j]->client;
|
Client *c = a->frame.data[j]->client;
|
||||||
if((v->sel == i) && (a->sel == j)) {
|
update_client_grab(c, (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);
|
|
||||||
if(j == a->sel)
|
if(j == a->sel)
|
||||||
continue;
|
continue;
|
||||||
wins[n++] = c->framewin;
|
wins[n++] = c->framewin;
|
||||||
|
@ -232,6 +232,7 @@ Client *sel_client();
|
|||||||
int idx_of_client_id(unsigned short id);
|
int idx_of_client_id(unsigned short id);
|
||||||
Client *client_of_win(Window w);
|
Client *client_of_win(Window w);
|
||||||
void draw_clients();
|
void draw_clients();
|
||||||
|
void update_client_grab(Client *c, Bool is_sel);
|
||||||
|
|
||||||
/* column.c */
|
/* column.c */
|
||||||
void arrange_column(Area *a, Bool dirty);
|
void arrange_column(Area *a, Bool dirty);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user