diff options
| author | Dana Jansens <danakj@orodu.net> | 2007-05-14 23:21:53 +0000 |
|---|---|---|
| committer | Dana Jansens <danakj@orodu.net> | 2007-05-14 23:21:53 +0000 |
| commit | f5d7952a9470f132a612d71b8c86a1279ea3efa3 (patch) | |
| tree | edf8a8da5492f4318959fd3279a6a57e83e16ac1 /openbox/client.c | |
| parent | f9fe78d970fa1ef62d56160db7a82fa6948643b6 (diff) | |
big scary g_assert(). interactive actions should never move focus until they're done.
Diffstat (limited to 'openbox/client.c')
| -rw-r--r-- | openbox/client.c | 33 |
1 files changed, 18 insertions, 15 deletions
diff --git a/openbox/client.c b/openbox/client.c index e51ad65e..b3f13684 100644 --- a/openbox/client.c +++ b/openbox/client.c @@ -2399,11 +2399,13 @@ gboolean client_should_show(ObClient *self) return FALSE; } -void client_show(ObClient *self) +gboolean client_show(ObClient *self) { + gboolean show = FALSE; if (client_should_show(self)) { frame_show(self->frame); + show = TRUE; } /* According to the ICCCM (sec 4.1.3.1) when a window is not visible, it @@ -2411,27 +2413,30 @@ void client_show(ObClient *self) desktop! */ client_change_wm_state(self); + return show; } -void client_hide(ObClient *self) +gboolean client_hide(ObClient *self) { - if (!client_should_show(self)) + gboolean hide = FALSE; + + if (!client_should_show(self)) { frame_hide(self->frame); + hide = TRUE; + } /* According to the ICCCM (sec 4.1.3.1) when a window is not visible, it needs to be in IconicState. This includes when it is on another desktop! */ client_change_wm_state(self); + return hide; } void client_showhide(ObClient *self) { - - if (client_should_show(self)) - frame_show(self->frame); - else - frame_hide(self->frame); + if (!client_show(self)) + client_hide(self); /* According to the ICCCM (sec 4.1.3.1) when a window is not visible, it needs to be in IconicState. This includes when it is on another @@ -3338,15 +3343,13 @@ gboolean client_focus(ObClient *self) "Focusing client \"%s\" at time %u\n", self->title, event_curtime); - /* if there is a grab going on, then we need to cancel it. if we move - focus during the grab, applications will get NotifyWhileGrabbed events - and ignore them ! + /* if we move focus during a grab, applications will get + NotifyWhileGrabbed events and ignore them ! - actions should not rely on being able to move focus during an - interactive grab. + interactive actions should not do anything that can move focus until + their finishing. */ - if (keyboard_interactively_grabbed()) - keyboard_interactive_cancel(); + g_assert(keyboard_interactively_grabbed()); error = FALSE; xerror_set_ignore(TRUE); |
