[Xfce4-commits] <xfwm4:master> Fix crash when workspace count is set to negative values (Bug #8002)

Olivier Fourdan noreply at xfce.org
Wed Oct 26 20:44:01 CEST 2011


Updating branch refs/heads/master
         to e15efbce6b0a8f0ef0fe5ef008bab959c9ee0cf0 (commit)
       from add1dd2b8b14bf54ad67b41a28de061bb70bc26f (commit)

commit e15efbce6b0a8f0ef0fe5ef008bab959c9ee0cf0
Author: Olivier Fourdan <fourdan at xfce.org>
Date:   Wed Oct 26 20:40:02 2011 +0200

    Fix crash when workspace count is set to negative values (Bug #8002)

 src/settings.c |    8 +++-----
 1 files changed, 3 insertions(+), 5 deletions(-)

diff --git a/src/settings.c b/src/settings.c
index 58175f3..da23b10 100644
--- a/src/settings.c
+++ b/src/settings.c
@@ -874,9 +874,7 @@ loadSettings (ScreenInfo *screen_info)
 
     if (screen_info->workspace_count == 0)
     {
-        guint workspace_count;
-        workspace_count = MAX ((guint) getIntValue ("workspace_count", rc), 1);
-        workspaceSetCount (screen_info, workspace_count);
+        workspaceSetCount (screen_info, (guint) MAX (getIntValue ("workspace_count", rc), 1));
     }
 
     freeRc (rc);
@@ -1034,7 +1032,7 @@ initSettings (ScreenInfo *screen_info)
     }
     if (getHint (display_info, screen_info->xroot, NET_NUMBER_OF_DESKTOPS, &val))
     {
-        workspaceSetCount (screen_info, val);
+        workspaceSetCount (screen_info, (guint) MAX (val, 1));
     }
 
     if (getUTF8StringList (display_info, screen_info->xroot, NET_DESKTOP_NAMES, &names, &i))
@@ -1147,7 +1145,7 @@ cb_xfwm4_channel_property_changed(XfconfChannel *channel, const gchar *property_
                 }
                 else if (!strcmp (name, "workspace_count"))
                 {
-                    workspaceSetCount(screen_info, g_value_get_int (value));
+                    workspaceSetCount(screen_info, (guint) MAX (g_value_get_int (value), 1));
                 }
                 else if (!strcmp (name, "frame_opacity"))
                 {


More information about the Xfce4-commits mailing list