mirror of
https://github.com/brl/mutter.git
synced 2024-11-25 09:30:45 -05:00
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
This commit is contained in:
parent
679edac9c3
commit
20a6243c85
@ -80,9 +80,6 @@ typedef struct
|
|||||||
*/
|
*/
|
||||||
GSList *combos;
|
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 */
|
/* for keybindings that apply only to a window */
|
||||||
gboolean per_window:1;
|
gboolean per_window:1;
|
||||||
|
|
||||||
|
@ -636,26 +636,6 @@ rebuild_binding_table (MetaKeyBindingManager *keys,
|
|||||||
b->mask = 0;
|
b->mask = 0;
|
||||||
|
|
||||||
g_hash_table_add (keys->key_bindings, b);
|
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;
|
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
|
* 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
|
* list with a single element of either "" or "disabled", the keybinding is
|
||||||
* disabled.
|
* 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.
|
* Use meta_display_remove_keybinding() to remove the binding.
|
||||||
*
|
*
|
||||||
|
@ -2033,23 +2033,6 @@ update_binding (MetaKeyPref *binding,
|
|||||||
continue;
|
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 = g_malloc0 (sizeof (MetaKeyCombo));
|
||||||
combo->keysym = keysym;
|
combo->keysym = keysym;
|
||||||
combo->keycode = keycode;
|
combo->keycode = keycode;
|
||||||
@ -2225,7 +2208,6 @@ meta_prefs_add_keybinding (const char *name,
|
|||||||
pref->settings = g_object_ref (settings);
|
pref->settings = g_object_ref (settings);
|
||||||
pref->action = action;
|
pref->action = action;
|
||||||
pref->combos = NULL;
|
pref->combos = NULL;
|
||||||
pref->add_shift = (flags & META_KEY_BINDING_REVERSES) != 0;
|
|
||||||
pref->per_window = (flags & META_KEY_BINDING_PER_WINDOW) != 0;
|
pref->per_window = (flags & META_KEY_BINDING_PER_WINDOW) != 0;
|
||||||
pref->builtin = (flags & META_KEY_BINDING_BUILTIN) != 0;
|
pref->builtin = (flags & META_KEY_BINDING_BUILTIN) != 0;
|
||||||
|
|
||||||
|
@ -377,7 +377,7 @@ typedef enum
|
|||||||
META_KEY_BINDING_NONE,
|
META_KEY_BINDING_NONE,
|
||||||
META_KEY_BINDING_PER_WINDOW = 1 << 0,
|
META_KEY_BINDING_PER_WINDOW = 1 << 0,
|
||||||
META_KEY_BINDING_BUILTIN = 1 << 1,
|
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
|
META_KEY_BINDING_IS_REVERSED = 1 << 3
|
||||||
} MetaKeyBindingFlags;
|
} MetaKeyBindingFlags;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user