summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDanny Baumann <dannybaumann@web.de>2009-01-14 08:21:10 +0100
committerDanny Baumann <dannybaumann@web.de>2009-01-14 08:21:10 +0100
commitf62a2895ea311bf34ac65ec362738106856f06fb (patch)
tree947dc7c7c5500fb8de8ecd1bbe50e744396000e9
parenta71dc917cd72770dda6b0aa3a5869f74bb3410b2 (diff)
downloadcompizconfig-backend-gsettings-f62a2895ea311bf34ac65ec362738106856f06fb.tar.gz
compizconfig-backend-gsettings-f62a2895ea311bf34ac65ec362738106856f06fb.tar.bz2
Don't allow empty modifiers for mouse_button_modifier.
Fixes bug #1106.
-rw-r--r--settings-backend/gconf.c36
1 files changed, 19 insertions, 17 deletions
diff --git a/settings-backend/gconf.c b/settings-backend/gconf.c
index 198a2ab..85651e1 100644
--- a/settings-backend/gconf.c
+++ b/settings-backend/gconf.c
@@ -1394,28 +1394,25 @@ writeListValue (CCSSetting *setting,
g_slist_free (valueList);
}
-static void
+static Bool
setGnomeMouseButtonModifier (unsigned int modMask)
{
char *modifiers, *currentValue;
GError *err = NULL;
modifiers = ccsModifiersToString (modMask);
-
if (!modifiers)
- modifiers = strdup ("");
- if (!modifiers)
- return;
+ return FALSE;
- currentValue =
- gconf_client_get_string(client,
- METACITY "/general/mouse_button_modifier",
- &err);
+ currentValue = gconf_client_get_string (client,
+ METACITY
+ "/general/mouse_button_modifier",
+ &err);
if (err)
{
free (modifiers);
g_error_free (err);
- return;
+ return FALSE;
}
if (!currentValue || (strcmp (currentValue, modifiers) != 0))
@@ -1426,6 +1423,8 @@ setGnomeMouseButtonModifier (unsigned int modMask)
g_free (currentValue);
free (modifiers);
+
+ return TRUE;
}
static void
@@ -1598,13 +1597,16 @@ writeIntegratedOption (CCSContext *context,
unsigned int modMask;
modMask = setting->value->value.asButton.buttonModMask;
- setGnomeMouseButtonModifier (modMask);
- setButtonBindingForSetting (context, "move",
- "initiate_button", 1, modMask);
- setButtonBindingForSetting (context, "resize",
- "initiate_button", 2, modMask);
- setButtonBindingForSetting (context, "core",
- "window_menu_button", 3, modMask);
+ if (setGnomeMouseButtonModifier (modMask))
+ {
+ setButtonBindingForSetting (context, "move",
+ "initiate_button", 1, modMask);
+ setButtonBindingForSetting (context, "resize",
+ "initiate_button", 2, modMask);
+ setButtonBindingForSetting (context, "core",
+ "window_menu_button",
+ 3, modMask);
+ }
}
}
break;