commit fe4aff6a20024d9480199e19c13614dd118be725
Author: Harald Judt <h.judt@gmx.at>
Date: Fri May 4 22:24:12 2012 +0200
Enable <Shift> as modifier key in shortcuts grabber.
This restores the functionality of <Shift> as a modifier key.
Using <Shift_L> and <Shift_R> as a single key is still possible.
It seems gtk_accelerator_name is not designed to distinguish between
upper-/lowercase, so we just store the <Shift> key in the accelerator
name. This might not be the recommended way to store accelerators
as specified by the GTK docs, but at least it fixes the regression
and seems to not cause any troubles.
Additionally, we need to gtk_accelerator_parse the value returned by
gtk_accelerator_name, because the key values of both functions are
not consistent.
diff --git a/libxfce4kbd-private/xfce-shortcuts-grabber.c b/libxfce4kbd-private/xfce-shortcuts-grabber.c
index 9faec07..01b85c3 100644
--- a/libxfce4kbd-private/xfce-shortcuts-grabber.c
+++ b/libxfce4kbd-private/xfce-shortcuts-grabber.c
@@ -512,8 +512,10 @@ xfce_shortcuts_grabber_event_filter (GdkXEvent *gdk_xevent,
&keyval, NULL, NULL, &consumed);
/* Get the modifiers */
- modifiers &= ~consumed;
+ if ((modifiers & GDK_SHIFT_MASK) && (consumed & GDK_SHIFT_MASK))
+ consumed &= ~GDK_SHIFT_MASK;
gdk_keymap_add_virtual_modifiers (keymap, &modifiers);
+ modifiers &= ~consumed;
modifiers &= mod_mask;
context.keyval = keyval;
@@ -521,6 +523,7 @@ xfce_shortcuts_grabber_event_filter (GdkXEvent *gdk_xevent,
raw_shortcut_name = gtk_accelerator_name (keyval, modifiers);
TRACE ("Looking for %s", raw_shortcut_name);
+ gtk_accelerator_parse (raw_shortcut_name, &context.keyval, &context.modifiers);
g_free (raw_shortcut_name);
g_hash_table_foreach (grabber->priv->keys, (GHFunc) find_event_key, &context);