[gnome-settings-daemon] common: Remove Core X key matching
- From: Bastien Nocera <hadess src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-settings-daemon] common: Remove Core X key matching
- Date: Wed, 14 Dec 2011 18:56:22 +0000 (UTC)
commit 721a962a6df81da9bd2f06b1026a75d989258274
Author: Bastien Nocera <hadess hadess net>
Date: Wed Dec 14 16:30:12 2011 +0000
common: Remove Core X key matching
As it's unused.
plugins/common/gsd-keygrab.c | 47 ------------------------------------------
plugins/common/gsd-keygrab.h | 2 -
2 files changed, 0 insertions(+), 49 deletions(-)
---
diff --git a/plugins/common/gsd-keygrab.c b/plugins/common/gsd-keygrab.c
index bb2f20c..ace44cd 100644
--- a/plugins/common/gsd-keygrab.c
+++ b/plugins/common/gsd-keygrab.c
@@ -335,53 +335,6 @@ match_xi2_key (Key *key, XIDeviceEvent *event)
&& key_uses_keycode (key, keycode));
}
-gboolean
-match_key (Key *key, XEvent *event)
-{
- guint keyval;
- GdkModifierType consumed;
- gint group;
-
- if (key == NULL)
- return FALSE;
-
- setup_modifiers ();
-
- if (have_xkb (event->xkey.display))
- group = XkbGroupForCoreState (event->xkey.state);
- else
- group = (event->xkey.state & GDK_KEY_Mode_switch) ? 1 : 0;
-
- /* Check if we find a keysym that matches our current state */
- if (gdk_keymap_translate_keyboard_state (gdk_keymap_get_default (), event->xkey.keycode,
- event->xkey.state, group,
- &keyval, NULL, NULL, &consumed)) {
- guint lower, upper;
- guint mask;
-
- /* The Key structure contains virtual modifiers, whereas
- * the XEvent will be using the real modifier, so translate those */
- mask = key->state;
- gdk_keymap_map_virtual_modifiers (gdk_keymap_get_default (), &mask);
-
- gdk_keyval_convert_case (keyval, &lower, &upper);
-
- /* If we are checking against the lower version of the
- * keysym, we might need the Shift state for matching,
- * so remove it from the consumed modifiers */
- if (lower == key->keysym)
- consumed &= ~GDK_SHIFT_MASK;
-
- return ((lower == key->keysym || upper == key->keysym)
- && (event->xkey.state & ~consumed & gsd_used_mods) == mask);
- }
-
- /* The key we passed doesn't have a keysym, so try with just the keycode */
- return (key != NULL
- && key->state == (event->xkey.state & gsd_used_mods)
- && key_uses_keycode (key, event->xkey.keycode));
-}
-
Key *
parse_key (const char *str)
{
diff --git a/plugins/common/gsd-keygrab.h b/plugins/common/gsd-keygrab.h
index 6b35ae7..8e92dd2 100644
--- a/plugins/common/gsd-keygrab.h
+++ b/plugins/common/gsd-keygrab.h
@@ -39,8 +39,6 @@ void grab_key_unsafe (Key *key,
gboolean match_xi2_key (Key *key,
XIDeviceEvent *event);
-gboolean match_key (Key *key,
- XEvent *event);
gboolean key_uses_keycode (const Key *key,
guint keycode);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]