]> Dogcows Code - chaz/openbox/commitdiff
start on the current desktop when a wm was already running
authorDana Jansens <danakj@orodu.net>
Sun, 22 Apr 2007 14:16:33 +0000 (14:16 +0000)
committerDana Jansens <danakj@orodu.net>
Sun, 22 Apr 2007 14:16:33 +0000 (14:16 +0000)
openbox/screen.c

index d5d61f507e643feaaf146fdb985aeaf2ff1b54fb..2d34f2632cd07060886f94b0dd0e6f16167999a5 100644 (file)
@@ -300,8 +300,16 @@ void screen_startup(gboolean reconfig)
         screen_num_desktops = 0;
     screen_set_num_desktops(config_desktops_num);
     if (!reconfig) {
-        screen_set_desktop(MIN(config_screen_firstdesk, screen_num_desktops)
-                           - 1);
+        guint32 d;
+        /* start on the current desktop when a wm was already running */
+        if (PROP_GET32(RootWindow(ob_display, ob_screen),
+                       net_current_desktop, cardinal, &d) &&
+            d < screen_num_desktops)
+        {
+            screen_set_desktop(d);
+        } else
+            screen_set_desktop(MIN(config_screen_firstdesk,
+                                   screen_num_desktops) - 1);
 
         /* don't start in showing-desktop mode */
         screen_showing_desktop = FALSE;
This page took 0.023607 seconds and 4 git commands to generate.