summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOwen W. Taylor <otaylor@fishsoup.net>2009-11-20 10:19:03 -0500
committerAlberts Muktupāvels <alberts.muktupavels@gmail.com>2017-07-21 13:40:27 +0300
commit564cf4faa86536f6c7d43de43add341cdbcdaa19 (patch)
treeb3ec49b91702bb1244d489068d1963efc5673501
parent27c6ce852ea70e45d77bf3a9d271cc35f8d7466f (diff)
downloadmetacity-564cf4faa86536f6c7d43de43add341cdbcdaa19.tar.gz
Accept an empty string as well as "disabled" for keybindings
Treat the empty string the same as "disabled" for GConf keybinding keys. gnome-keybinding-properties was changed to write disabled keys as the empty string a year or so ago. https://bugzilla.gnome.org/show_bug.cgi?id=559816
-rw-r--r--src/ui/ui.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/ui/ui.c b/src/ui/ui.c
index cf429256..a72bfa47 100644
--- a/src/ui/ui.c
+++ b/src/ui/ui.c
@@ -956,7 +956,7 @@ meta_ui_parse_accelerator (const char *accel,
*keycode = 0;
*mask = 0;
- if (strcmp (accel, "disabled") == 0)
+ if (!accel[0] || strcmp (accel, "disabled") == 0)
return TRUE;
meta_ui_accelerator_parse (accel, &gdk_sym, &gdk_code, &gdk_mask);
@@ -1006,7 +1006,7 @@ meta_ui_parse_modifier (const char *accel,
*mask = 0;
- if (accel == NULL || strcmp (accel, "disabled") == 0)
+ if (accel == NULL || !accel[0] || strcmp (accel, "disabled") == 0)
return TRUE;
meta_ui_accelerator_parse (accel, &gdk_sym, &gdk_code, &gdk_mask);