]> Dogcows Code - chaz/openbox/commitdiff
print a warning when the session has a different number of desktops than the openbox...
authorDana Jansens <danakj@orodu.net>
Tue, 22 Jan 2008 17:54:53 +0000 (12:54 -0500)
committerDana Jansens <danakj@orodu.net>
Tue, 22 Jan 2008 18:01:56 +0000 (13:01 -0500)
openbox/config.c
openbox/config.h
openbox/screen.c

index 867dfb514ac876621dc90ea5b7cb8315a048b034..56e625d4c3d9c712cc25bc447c6e59e0d8e1c8ca 100644 (file)
@@ -55,7 +55,7 @@ RrFont *config_font_menuitem;
 RrFont *config_font_menutitle;
 RrFont *config_font_osd;
 
-gint    config_desktops_num;
+guint   config_desktops_num;
 GSList *config_desktops_names;
 guint   config_screen_firstdesk;
 guint   config_desktop_popup_time;
@@ -605,7 +605,7 @@ static void parse_desktops(ObParseInst *i, xmlDocPtr doc, xmlNodePtr node,
     if ((n = parse_find_node("number", node))) {
         gint d = parse_int(doc, n);
         if (d > 0)
-            config_desktops_num = d;
+            config_desktops_num = (unsigned) d;
     }
     if ((n = parse_find_node("firstdesk", node))) {
         gint d = parse_int(doc, n);
index 240b04f1c4d637802cece3495e0106fa3ab4fba4..50e7dfe3fdb938e7a3b7802e6b3fb7cc13f97461 100644 (file)
@@ -143,7 +143,7 @@ extern RrFont *config_font_menuitem;
 extern RrFont *config_font_osd;
 
 /*! The number of desktops */
-extern gint config_desktops_num;
+extern guint config_desktops_num;
 /*! Desktop to start on, put 5 to start in the center of a 3x3 grid */
 extern guint config_screen_firstdesk;
 /*! Names for the desktops */
index e008ffe5dfa644e3ce42017b2a615d338de8d9a9..932b157e1cf54add2dab54b01feb749d0c951643 100644 (file)
@@ -402,7 +402,13 @@ void screen_startup(gboolean reconfig)
     screen_num_desktops = 0;
     if (PROP_GET32(RootWindow(ob_display, 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);
This page took 0.034877 seconds and 4 git commands to generate.