]> Dogcows Code - chaz/openbox/blobdiff - openbox/screen.c
Merge branch 'backport'
[chaz/openbox] / openbox / screen.c
index dde0443ec63d7335cbc80d15cb6874c47e825afd..90f8b27c76cbd13c29c74c07e78ab79cf9bfd8e9 100644 (file)
@@ -58,7 +58,7 @@ static void     screen_fallback_focus(void);
 guint    screen_num_desktops;
 guint    screen_num_monitors;
 guint    screen_desktop;
-guint    screen_last_desktop = 1;
+guint    screen_last_desktop;
 gboolean screen_showing_desktop;
 ObDesktopLayout screen_desktop_layout;
 gchar  **screen_desktop_names;
@@ -290,6 +290,7 @@ gboolean screen_annex(void)
     supported[i++] = OBT_PROP_ATOM(OB_WM_STATE_UNDECORATED);
     supported[i++] = OBT_PROP_ATOM(OPENBOX_PID);
     supported[i++] = OBT_PROP_ATOM(OB_THEME);
+    supported[i++] = OBT_PROP_ATOM(OB_CONFIG_FILE);
     supported[i++] = OBT_PROP_ATOM(OB_CONTROL);
     g_assert(i == num_support);
 
@@ -391,7 +392,13 @@ void screen_startup(gboolean reconfig)
     screen_num_desktops = 0;
     if (OBT_PROP_GET32(obt_root(ob_screen),
                        NET_NUMBER_OF_DESKTOPS, CARDINAL, &d))
+    {
+        if (d != config_desktops_num) {
+            g_warning(_("Openbox is configured for %d desktops, but the current session has %d.  Overriding the Openbox configuration."),
+                      config_desktops_num, d);
+        }
         screen_set_num_desktops(d);
+    }
     /* restore from session if possible */
     else if (session_num_desktops)
         screen_set_num_desktops(session_num_desktops);
@@ -599,10 +606,15 @@ void screen_set_desktop(guint num, gboolean dofocus)
         /* If screen_desktop_timeout is true, then we've been on this desktop
            long enough and we can save it as the last desktop. */
 
-        /* save the "last desktop" as the "old desktop" */
-        screen_old_desktop = screen_last_desktop;
-        /* save the desktop we're coming from as the "last desktop" */
-        screen_last_desktop = previous;
+        if (screen_last_desktop == previous)
+            /* this is the startup state only */
+            screen_old_desktop = screen_desktop;
+        else {
+            /* save the "last desktop" as the "old desktop" */
+            screen_old_desktop = screen_last_desktop;
+            /* save the desktop we're coming from as the "last desktop" */
+            screen_last_desktop = previous;
+        }
     }
     else {
         /* If screen_desktop_timeout is false, then we just got to this desktop
@@ -656,7 +668,7 @@ void screen_set_desktop(guint num, gboolean dofocus)
     obt_main_loop_timeout_add(ob_main_loop, REMEMBER_LAST_DESKTOP_TIME,
                               last_desktop_func, NULL, NULL, NULL);
 
-    ob_debug("Moving to desktop %d\n", num+1);
+    ob_debug("Moving to desktop %d", num+1);
 
     /* ignore enter events caused by the move */
     ignore_start = event_start_ignore_all_enters();
@@ -713,7 +725,7 @@ void screen_add_desktop(gboolean current)
                    parent - which will have to be on the same desktop */
                 !client_direct_parent(c))
             {
-                ob_debug("moving window %s\n", c->title);
+                ob_debug("moving window %s", c->title);
                 client_set_desktop(c, c->desktop+1, FALSE, TRUE);
             }
         }
@@ -754,7 +766,7 @@ void screen_remove_desktop(gboolean current)
                    parent - which will have to be on the same desktop */
                 !client_direct_parent(c))
             {
-                ob_debug("moving window %s\n", c->title);
+                ob_debug("moving window %s", c->title);
                 client_set_desktop(c, c->desktop - 1, TRUE, TRUE);
             }
             /* raise all the windows that are on the current desktop which
@@ -764,7 +776,7 @@ void screen_remove_desktop(gboolean current)
                 (d == DESKTOP_ALL || d == screen_desktop))
             {
                 stacking_raise(CLIENT_AS_WINDOW(c));
-                ob_debug("raising window %s\n", c->title);
+                ob_debug("raising window %s", c->title);
             }
         }
     }
@@ -772,7 +784,7 @@ void screen_remove_desktop(gboolean current)
     /* fallback focus like we're changing desktops */
     if (screen_desktop < screen_num_desktops - 1) {
         screen_fallback_focus();
-        ob_debug("fake desktop change\n");
+        ob_debug("fake desktop change");
     }
 
     screen_set_num_desktops(screen_num_desktops-1);
@@ -1284,7 +1296,6 @@ static void get_xinerama_screens(Rect **xin_areas, guint *nxin)
     gint l, r, t, b;
 
     if (ob_debug_xinerama) {
-        g_print("Using fake xinerama !\n");
         gint w = WidthOfScreen(ScreenOfDisplay(obt_display, ob_screen));
         gint h = HeightOfScreen(ScreenOfDisplay(obt_display, ob_screen));
         *nxin = 2;
This page took 0.024372 seconds and 4 git commands to generate.