summaryrefslogtreecommitdiffstats
path: root/metacity-2.28-empty-keybindings.patch
blob: cc76a9b2cd36e849bcf659a9819dce2076e53cc4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
From 599f25e51d967febddb4de3aa21db4258356a9f9 Mon Sep 17 00:00:00 2001
From: Owen W. Taylor <otaylor@fishsoup.net>
Date: Fri, 20 Nov 2009 10:19:03 -0500
Subject: [PATCH] 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
---
 src/ui/ui.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/ui/ui.c b/src/ui/ui.c
index 6df289f..1e68df0 100644
--- a/src/ui/ui.c
+++ b/src/ui/ui.c
@@ -765,7 +765,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);
@@ -852,7 +852,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);
-- 
1.6.5.2