summaryrefslogtreecommitdiff
path: root/openbox/screen.c
diff options
context:
space:
mode:
Diffstat (limited to 'openbox/screen.c')
-rw-r--r--openbox/screen.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/openbox/screen.c b/openbox/screen.c
index c566a908..1c058d99 100644
--- a/openbox/screen.c
+++ b/openbox/screen.c
@@ -536,7 +536,11 @@ void screen_set_desktop(guint num, gboolean dofocus)
do this before hiding the windows so if helper windows are coming
with us, they don't get hidden
*/
- if (dofocus && (c = focus_fallback(TRUE))) {
+ if (dofocus
+ && (!focus_client || (focus->client.desktop != DESKTOP_ALL
+ && focus->client.desktop != num))
+ && (c = focus_fallback(TRUE)))
+ {
/* only do the flicker reducing stuff ahead of time if we are going
to call xsetinputfocus on the window ourselves. otherwise there is
no guarantee the window will actually take focus.. */