[gnome-settings-daemon/gnome-3-2] common: Fix handling of <Primary>



commit fe51a74d2331542bd5b4ed9e03067ed8d11098bc
Author: Bastien Nocera <hadess hadess net>
Date:   Mon Oct 24 19:06:27 2011 +0100

    common: Fix handling of <Primary>
    
    As used in the new GTK+ 3.2.1.
    
    https://bugzilla.redhat.com/show_bug.cgi?id=748444

 plugins/common/eggaccelerators.c |   20 ++++++++++++++++++++
 1 files changed, 20 insertions(+), 0 deletions(-)
---
diff --git a/plugins/common/eggaccelerators.c b/plugins/common/eggaccelerators.c
index c0b6c86..1122f33 100644
--- a/plugins/common/eggaccelerators.c
+++ b/plugins/common/eggaccelerators.c
@@ -178,6 +178,20 @@ is_hyper (const gchar *string)
 }
 
 static inline gboolean
+is_primary (const gchar *string)
+{
+	return ((string[0] == '<') &&
+		(string[1] == 'p' || string[1] == 'P') &&
+		(string[2] == 'r' || string[2] == 'R') &&
+		(string[3] == 'i' || string[3] == 'I') &&
+		(string[4] == 'm' || string[4] == 'M') &&
+		(string[5] == 'a' || string[5] == 'A') &&
+		(string[6] == 'r' || string[6] == 'R') &&
+		(string[7] == 'y' || string[7] == 'Y') &&
+		(string[8] == '>'));
+}
+
+static inline gboolean
 is_keycode (const gchar *string)
 {
   return ((string[0] == '0') &&
@@ -312,6 +326,12 @@ egg_accelerator_parse_virtual (const gchar            *accelerator,
 	      len -= 7;
 	      mods |= EGG_VIRTUAL_SUPER_MASK;
 	    }
+	  else if (len >= 9 && is_primary (accelerator))
+	    {
+	      accelerator += 9;
+	      len -= 9;
+	      mods |= EGG_VIRTUAL_CONTROL_MASK;
+	    }
 	  else
 	    {
 	      gchar last_ch;



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]