summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDana Jansens <danakj@orodu.net>2007-05-17 00:56:29 +0000
committerDana Jansens <danakj@orodu.net>2007-05-17 00:56:29 +0000
commit619eeaa962e8718901cfc9eabe56e503ba40cd90 (patch)
tree16e7941cca2c04fac8d0fda1e75a95815733b5f5
parent4fdf8a431538eece230016ec2e0fd94d62fcec93 (diff)
grab the pointer accross actions run by the applications, the same as for
actions run by the user
-rw-r--r--openbox/client.c24
1 files changed, 18 insertions, 6 deletions
diff --git a/openbox/client.c b/openbox/client.c
index c4dc86f5..cfe2958b 100644
--- a/openbox/client.c
+++ b/openbox/client.c
@@ -3268,6 +3268,11 @@ void client_set_state(ObClient *self, Atom action, glong data1, glong data2)
}
}
}
+
+ /* Grab pointer across these, so it is the same as actions. Enter events
+ won't be generated by the windows moving around */
+ grab_pointer(FALSE, FALSE, OB_CURSOR_NONE);
+
if (max_horz != self->max_horz || max_vert != self->max_vert) {
if (max_horz != self->max_horz && max_vert != self->max_vert) {
/* toggling both */
@@ -3293,11 +3298,24 @@ void client_set_state(ObClient *self, Atom action, glong data1, glong data2)
client_shade(self, shaded);
if (undecorated != self->undecorated)
client_set_undecorated(self, undecorated);
+ if (above != self->above || below != self->below) {
+ self->above = above;
+ self->below = below;
+ client_calc_layer(self);
+ }
+
+ /* These things below can change focus so we can't grab pointer for them */
+ ungrab_pointer();
+
if (modal != self->modal) {
self->modal = modal;
/* when a window changes modality, then its stacking order with its
transients needs to change */
stacking_raise(CLIENT_AS_WINDOW(self));
+ /* it also may get focused. if something is focused that shouldn't
+ be focused anymore, then move the focus */
+ if (focus_client && client_focus_target(focus_client) != focus_client)
+ client_focus(focus_client);
}
if (iconic != self->iconic)
client_iconify(self, iconic, FALSE, FALSE);
@@ -3305,12 +3323,6 @@ void client_set_state(ObClient *self, Atom action, glong data1, glong data2)
if (demands_attention != self->demands_attention)
client_hilite(self, demands_attention);
- if (above != self->above || below != self->below) {
- self->above = above;
- self->below = below;
- client_calc_layer(self);
- }
-
client_change_state(self); /* change the hint to reflect these changes */
}