[mutter] Remove use of META_KEY_BINDING_REVERSES
- From: Christophe Fergeau <teuf src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [mutter] Remove use of META_KEY_BINDING_REVERSES
- Date: Sun, 17 Aug 2014 17:32:29 +0000 (UTC)
commit 20a6243c850b7ef9141de1c268b05ff32a8c14b7
Author: Christophe Fergeau <cfergeau redhat com>
Date: Wed Jul 2 19:28:58 2014 +0200
Remove use of META_KEY_BINDING_REVERSES
Now that the internal mutter bindings and gnome-shell stopped using
META_KEY_BINDING_REVERSES, and after moving the 'adding shift reverses
the keybinding action' logic to gnome-control-center, we can remove
META_KEY_BINDING_REVERSES from mutter.
Plugin API is broken as this constant is removed from the exported
headers. ABI is broken as using this flag is now a noop.
https://bugzilla.gnome.org/show_bug.cgi?id=732385
src/core/keybindings-private.h | 3 ---
src/core/keybindings.c | 24 ------------------------
src/core/prefs.c | 18 ------------------
src/meta/prefs.h | 2 +-
4 files changed, 1 insertions(+), 46 deletions(-)
---
diff --git a/src/core/keybindings-private.h b/src/core/keybindings-private.h
index 9c84285..5cd8c0e 100644
--- a/src/core/keybindings-private.h
+++ b/src/core/keybindings-private.h
@@ -80,9 +80,6 @@ typedef struct
*/
GSList *combos;
- /* for keybindings that can have shift or not like Alt+Tab */
- gboolean add_shift:1;
-
/* for keybindings that apply only to a window */
gboolean per_window:1;
diff --git a/src/core/keybindings.c b/src/core/keybindings.c
index 8fc28d4..41e8165 100644
--- a/src/core/keybindings.c
+++ b/src/core/keybindings.c
@@ -636,26 +636,6 @@ rebuild_binding_table (MetaKeyBindingManager *keys,
b->mask = 0;
g_hash_table_add (keys->key_bindings, b);
-
- if (pref->add_shift &&
- (combo->modifiers & META_VIRTUAL_SHIFT_MASK) == 0)
- {
- meta_topic (META_DEBUG_KEYBINDINGS,
- "Binding %s also needs Shift grabbed\n",
- pref->name);
-
- b = g_malloc0 (sizeof (MetaKeyBinding));
-
- b->name = pref->name;
- b->handler = handler;
- b->flags = handler->flags;
- b->keysym = combo->keysym;
- b->keycode = combo->keycode;
- b->modifiers = combo->modifiers | META_VIRTUAL_SHIFT_MASK;
- b->mask = 0;
-
- g_hash_table_add (keys->key_bindings, b);
- }
}
tmp = tmp->next;
@@ -832,10 +812,6 @@ add_builtin_keybinding (MetaDisplay *display,
* such as "<Ctl>" and "<Ctrl>". If the key is set to the empty list or a
* list with a single element of either "" or "disabled", the keybinding is
* disabled.
- * If %META_KEY_BINDING_REVERSES is specified in @flags, the binding
- * may be reversed by holding down the "shift" key; therefore, "<Shift>"
- * cannot be one of the keys used. @handler is expected to check for the
- * "shift" modifier in this case and reverse its action.
*
* Use meta_display_remove_keybinding() to remove the binding.
*
diff --git a/src/core/prefs.c b/src/core/prefs.c
index 5b8966f..6fc1162 100644
--- a/src/core/prefs.c
+++ b/src/core/prefs.c
@@ -2033,23 +2033,6 @@ update_binding (MetaKeyPref *binding,
continue;
}
- /* Bug 329676: Bindings which can be shifted must not have no modifiers,
- * nor only SHIFT as a modifier.
- */
-
- if (binding->add_shift &&
- 0 != keysym &&
- (META_VIRTUAL_SHIFT_MASK == mods || 0 == mods))
- {
- meta_warning ("Cannot bind \"%s\" to %s: it needs a modifier "
- "such as Ctrl or Alt.\n",
- binding->name, strokes[i]);
-
- /* Value is kept and will thus be removed next time we save the key.
- * Changing the key in response to a modification could lead to cyclic calls. */
- continue;
- }
-
combo = g_malloc0 (sizeof (MetaKeyCombo));
combo->keysym = keysym;
combo->keycode = keycode;
@@ -2225,7 +2208,6 @@ meta_prefs_add_keybinding (const char *name,
pref->settings = g_object_ref (settings);
pref->action = action;
pref->combos = NULL;
- pref->add_shift = (flags & META_KEY_BINDING_REVERSES) != 0;
pref->per_window = (flags & META_KEY_BINDING_PER_WINDOW) != 0;
pref->builtin = (flags & META_KEY_BINDING_BUILTIN) != 0;
diff --git a/src/meta/prefs.h b/src/meta/prefs.h
index dac81c3..4d296ce 100644
--- a/src/meta/prefs.h
+++ b/src/meta/prefs.h
@@ -377,7 +377,7 @@ typedef enum
META_KEY_BINDING_NONE,
META_KEY_BINDING_PER_WINDOW = 1 << 0,
META_KEY_BINDING_BUILTIN = 1 << 1,
- META_KEY_BINDING_REVERSES = 1 << 2,
+/* 1 << 2 used to be META_KEY_BINDING_REVERSES which is deprecated */
META_KEY_BINDING_IS_REVERSED = 1 << 3
} MetaKeyBindingFlags;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]