Commit 7f5733b4 authored by Bastien Nocera's avatar Bastien Nocera

common: Fix handling of <Primary>

As used in the new GTK+ 3.2.1.

https://bugzilla.redhat.com/show_bug.cgi?id=748444
parent eacbe935
......@@ -177,6 +177,20 @@ is_hyper (const gchar *string)
(string[6] == '>'));
}
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)
{
......@@ -310,6 +324,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;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment