]> Dogcows Code - chaz/openbox/commitdiff
check desktop switching stuff in screen_set_desktop
authorMikael Magnusson <mikachu@comhem.se>
Fri, 25 May 2007 15:34:31 +0000 (15:34 +0000)
committerMikael Magnusson <mikachu@comhem.se>
Fri, 25 May 2007 15:34:31 +0000 (15:34 +0000)
openbox/action.c
openbox/screen.c

index 081b68f5293b921d91f1ba94f138cf21dc1fb5af..ffe0dc43464ed8273cd7edda12e946cf5fdb6301 100644 (file)
@@ -1588,7 +1588,7 @@ void action_send_to_desktop(union ActionData *data)
         data->sendto.desk == DESKTOP_ALL) {
         client_set_desktop(c, data->sendto.desk, data->sendto.follow);
         if (data->sendto.follow && data->sendto.desk != screen_desktop)
-            screen_set_desktop(data->sendto.desk, c != focus_client);
+            screen_set_desktop(data->sendto.desk, TRUE);
     }
 }
 
@@ -1599,9 +1599,10 @@ void action_desktop(union ActionData *data)
     if (data->desktop.desk < screen_num_desktops ||
         data->desktop.desk == DESKTOP_ALL)
     {
-        screen_set_desktop(data->desktop.desk, TRUE);
+        screen_set_desktop(data->desktop.desk, !focus_client
+                           || focus->client.desktop != DESKTOP_ALL);
         if (data->inter.any.interactive)
-            screen_desktop_popup(data->desktop.desk, focus_client->desktop != DESKTOP_ALL);
+            screen_desktop_popup(data->desktop.desk, TRUE);
     }
 }
 
@@ -1621,7 +1622,8 @@ void action_desktop_dir(union ActionData *data)
     if (!data->sendtodir.inter.any.interactive ||
         (data->sendtodir.inter.final && !data->sendtodir.inter.cancel))
     {
-        if (d != screen_desktop) screen_set_desktop(d, focus_client->desktop != DESKTOP_ALL);
+        if (d != screen_desktop)
+            screen_set_desktop(d, TRUE);
     }
 }
 
@@ -1645,7 +1647,7 @@ void action_send_to_desktop_dir(union ActionData *data)
     {
         client_set_desktop(c, d, data->sendtodir.follow);
         if (data->sendtodir.follow && d != screen_desktop)
-            screen_set_desktop(d, c != focus_client);
+            screen_set_desktop(d, TRUE);
     }
 }
 
index c566a908046c5e5a10547ef549a5bdf5ef978905..1c058d996b21b06460a0c2d1787fbec3e65f5acd 100644 (file)
@@ -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.. */
This page took 0.031427 seconds and 4 git commands to generate.