X-Git-Url: https://git.dogcows.com/gitweb?a=blobdiff_plain;f=openbox%2Fclient.c;h=fdc171fb87a80cfa6d373ec36e4839c149371722;hb=fdabd3daf9c631f53408d82c9168705dc6a2832a;hp=40c61208ca821113fb65a5c47636ad021c8c9cd9;hpb=f8a47de5ec444c452093371e3db16857eb39a490;p=chaz%2Fopenbox diff --git a/openbox/client.c b/openbox/client.c index 40c61208..fdc171fb 100644 --- a/openbox/client.c +++ b/openbox/client.c @@ -32,6 +32,7 @@ static void client_get_state(Client *self); static void client_get_shaped(Client *self); static void client_get_mwm_hints(Client *self); static void client_get_gravity(Client *self); +static void client_showhide(Client *self); static void client_change_allowed_actions(Client *self); static void client_change_state(Client *self); static Client *search_focus_tree(Client *node, Client *skip); @@ -204,7 +205,7 @@ void client_manage(Window window) HOOKFIRECLIENT(managed, client); - client_showhide(client, TRUE); + client_showhide(client); /* grab all mouse bindings */ pointer_grab_all(client, TRUE); @@ -1223,21 +1224,25 @@ void client_calc_layer(Client *self) } } -void client_showhide(Client *self, gboolean firehook) +gboolean client_should_show(Client *self) { - gboolean show; - - if (self->iconic) show = FALSE; + if (self->iconic) return FALSE; else if (!(self->desktop == screen_desktop || - self->desktop == DESKTOP_ALL)) show = FALSE; - else if (client_normal(self) && screen_showing_desktop) show = FALSE; - else show = TRUE; + self->desktop == DESKTOP_ALL)) return FALSE; + else if (client_normal(self) && screen_showing_desktop) return FALSE; + + return TRUE; +} - if (show) engine_frame_show(self->frame); - else engine_frame_hide(self->frame); +static void client_showhide(Client *self) +{ + + if (client_should_show(self)) + engine_frame_show(self->frame); + else + engine_frame_hide(self->frame); - if (firehook) - HOOKFIRECLIENT(visible, self); + HOOKFIRECLIENT(visible, self); } gboolean client_normal(Client *self) { @@ -1491,7 +1496,7 @@ void client_iconify(Client *self, gboolean iconic, gboolean curdesk) XMapWindow(ob_display, self->window); } client_change_state(self); - client_showhide(self, TRUE); + client_showhide(self); screen_update_struts(); } @@ -1657,7 +1662,7 @@ void client_set_desktop(Client *self, unsigned int target) /* the frame can display the current desktop state */ engine_frame_adjust_state(self->frame); /* 'move' the window to the new desktop */ - client_showhide(self, TRUE); + client_showhide(self); screen_update_struts(); }