X-Git-Url: https://git.dogcows.com/gitweb?a=blobdiff_plain;f=openbox%2Fclient.c;h=837dd0194a74a8ed4e74a362f8f91e0452f9a3b3;hb=b74cff0302e70d702e958a8205a6f6e2e2858192;hp=888e532b25c87a4418b2285b1e3e6913d2c80d59;hpb=415ce6e5de964ad4dda6b58694c73f45aa38c3b7;p=chaz%2Fopenbox diff --git a/openbox/client.c b/openbox/client.c index 888e532b..837dd019 100644 --- a/openbox/client.c +++ b/openbox/client.c @@ -65,7 +65,6 @@ typedef struct GList *client_list = NULL; static GSList *client_destroy_notifies = NULL; -static GSList *client_hide_notifies = NULL; static void client_get_all(ObClient *self, gboolean real); static void client_toggle_border(ObClient *self, gboolean show); @@ -139,29 +138,6 @@ void client_remove_destroy_notify(ObClientCallback func) } } -void client_add_hide_notify(ObClientCallback func, gpointer data) -{ - ClientCallback *d = g_new(ClientCallback, 1); - d->func = func; - d->data = data; - client_hide_notifies = g_slist_prepend(client_hide_notifies, d); -} - -void client_remove_hide_notify(ObClientCallback func) -{ - GSList *it; - - for (it = client_hide_notifies; it; it = g_slist_next(it)) { - ClientCallback *d = it->data; - if (d->func == func) { - g_free(d); - client_hide_notifies = - g_slist_delete_link(client_hide_notifies, it); - break; - } - } -} - void client_set_list() { Window *windows, *win_it; @@ -2367,12 +2343,9 @@ static ObStackingLayer calc_layer(ObClient *self) self->frame->size.bottom == 0 && self->frame->size.top == 0 && RECT_EQUAL(self->area, *screen_physical_area_monitor - (client_monitor(self))))))) { - if (client_focused(self) || client_search_focus_tree(self)) - l = OB_STACKING_LAYER_FULLSCREEN; - else - l = OB_STACKING_LAYER_FULLSCREEN_BELOW; - } + (client_monitor(self)))))) && + (client_focused(self) || client_search_focus_tree(self))) + l = OB_STACKING_LAYER_FULLSCREEN; else if (self->above) l = OB_STACKING_LAYER_ABOVE; else if (self->below) l = OB_STACKING_LAYER_BELOW; else l = OB_STACKING_LAYER_NORMAL; @@ -2426,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 @@ -2438,14 +2413,28 @@ void client_show(ObClient *self) desktop! */ client_change_wm_state(self); + return show; } -void client_hide(ObClient *self) +gboolean client_hide(ObClient *self) { + gboolean hide = FALSE; + if (!client_should_show(self)) { - frame_hide(self->frame); + if (self == focus_client) { + /* 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 ! - client_call_notifies(self, client_hide_notifies); + actions should not rely on being able to move focus during an + interactive grab. + */ + if (keyboard_interactively_grabbed()) + keyboard_interactive_cancel(); + } + + frame_hide(self->frame); + hide = TRUE; } /* According to the ICCCM (sec 4.1.3.1) when a window is not visible, it @@ -2453,19 +2442,13 @@ void client_hide(ObClient *self) 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); - - client_call_notifies(self, client_hide_notifies); - } + 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