From c03c08415f01a52584158aa4f0356f3a0d7a46aa Mon Sep 17 00:00:00 2001 From: Dana Jansens Date: Thu, 12 Apr 2007 02:26:26 +0000 Subject: don't fallback when a window is hidden right away, it's redundant, we'll get a focusout for the window after the unmapnotify anyways. show new windows when switching desktops before hiding the old windows. --- openbox/client.c | 33 ++++++++++++++++++++++++++++----- 1 file changed, 28 insertions(+), 5 deletions(-) (limited to 'openbox/client.c') diff --git a/openbox/client.c b/openbox/client.c index eb00e6d6..24fc2647 100644 --- a/openbox/client.c +++ b/openbox/client.c @@ -455,7 +455,7 @@ void client_manage(Window window) /* this has to happen before we try focus the window, but we want it to happen after the client's stacking has been determined or it looks bad */ - client_showhide(self); + client_show(self); /* use client_focus instead of client_activate cuz client_activate does stuff like switch desktops etc and I'm not interested in all that when @@ -2058,6 +2058,33 @@ gboolean client_should_show(ObClient *self) return FALSE; } +void client_show(ObClient *self) +{ + + if (client_should_show(self)) { + frame_show(self->frame); + } + + /* 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); +} + +void client_hide(ObClient *self) +{ + if (!client_should_show(self)) { + frame_hide(self->frame); + } + + /* 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); +} + void client_showhide(ObClient *self) { @@ -2066,10 +2093,6 @@ void client_showhide(ObClient *self) } else { frame_hide(self->frame); - - /* Fall back focus since we're disappearing */ - if (focus_client == self) - client_unfocus(self); } /* According to the ICCCM (sec 4.1.3.1) when a window is not visible, it -- cgit v1.2.3