fixed mouse grabbing for selection and resizals

This commit is contained in:
Anselm R. Garbe 2006-04-06 12:52:20 +02:00
parent 2b3eb084f7
commit 40a69dddaf
2 changed files with 10 additions and 8 deletions

View File

@ -90,14 +90,8 @@ focus_client(Client *c)
v->sel = i;
f->area->sel = frame2index(f);
if(old && (old != c)) {
grab_mouse(old->framewin, AnyModifier, Button1);
if(old)
draw_client(old);
}
ungrab_mouse(c->framewin, AnyModifier, AnyButton);
grab_mouse(c->framewin, Mod1Mask, Button1);
grab_mouse(c->framewin, Mod1Mask, Button3);
restack_view(v);
XSetInputFocus(dpy, c->win, RevertToPointerRoot, CurrentTime);

View File

@ -269,9 +269,17 @@ restack_view(View *v)
if(a->frame.size) {
wins[n++] = a->frame.data[a->sel]->client->framewin;
for(j = 0; j < a->frame.size; 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, Mod1Mask, Button1);
grab_mouse(c->framewin, Mod1Mask, Button3);
}
else
grab_mouse(c->framewin, AnyModifier, Button1);
if(j == a->sel)
continue;
wins[n++] = a->frame.data[j]->client->framewin;
wins[n++] = c->framewin;
}
}
}