mirror of
https://github.com/brl/mutter.git
synced 2024-11-25 09:30:45 -05:00
keybindings: Rename MetaKeyPref.bindings to MetaKeyPref.combos
Let's call it what it really is, otherwise it's just confusing since MetaKeyBinding also exists. https://bugzilla.gnome.org/show_bug.cgi?id=725588
This commit is contained in:
parent
f3b6fead4d
commit
46cbd0bf48
@ -78,7 +78,7 @@ typedef struct
|
|||||||
* this keypref. If one has keysym==modifiers==0, it is
|
* this keypref. If one has keysym==modifiers==0, it is
|
||||||
* ignored.
|
* ignored.
|
||||||
*/
|
*/
|
||||||
GSList *bindings;
|
GSList *combos;
|
||||||
|
|
||||||
/* for keybindings that can have shift or not like Alt+Tab */
|
/* for keybindings that can have shift or not like Alt+Tab */
|
||||||
gboolean add_shift:1;
|
gboolean add_shift:1;
|
||||||
|
@ -531,7 +531,7 @@ count_bindings (GList *prefs)
|
|||||||
while (p)
|
while (p)
|
||||||
{
|
{
|
||||||
MetaKeyPref *pref = (MetaKeyPref*)p->data;
|
MetaKeyPref *pref = (MetaKeyPref*)p->data;
|
||||||
GSList *tmp = pref->bindings;
|
GSList *tmp = pref->combos;
|
||||||
|
|
||||||
while (tmp)
|
while (tmp)
|
||||||
{
|
{
|
||||||
@ -575,7 +575,7 @@ rebuild_binding_table (MetaDisplay *display,
|
|||||||
while (p)
|
while (p)
|
||||||
{
|
{
|
||||||
MetaKeyPref *pref = (MetaKeyPref*)p->data;
|
MetaKeyPref *pref = (MetaKeyPref*)p->data;
|
||||||
GSList *tmp = pref->bindings;
|
GSList *tmp = pref->combos;
|
||||||
|
|
||||||
while (tmp)
|
while (tmp)
|
||||||
{
|
{
|
||||||
|
@ -1856,7 +1856,7 @@ init_bindings (void)
|
|||||||
pref = g_new0 (MetaKeyPref, 1);
|
pref = g_new0 (MetaKeyPref, 1);
|
||||||
pref->name = g_strdup ("overlay-key");
|
pref->name = g_strdup ("overlay-key");
|
||||||
pref->action = META_KEYBINDING_ACTION_OVERLAY_KEY;
|
pref->action = META_KEYBINDING_ACTION_OVERLAY_KEY;
|
||||||
pref->bindings = g_slist_prepend (pref->bindings, &overlay_key_combo);
|
pref->combos = g_slist_prepend (pref->combos, &overlay_key_combo);
|
||||||
pref->builtin = 1;
|
pref->builtin = 1;
|
||||||
|
|
||||||
g_hash_table_insert (key_bindings, g_strdup ("overlay-key"), pref);
|
g_hash_table_insert (key_bindings, g_strdup ("overlay-key"), pref);
|
||||||
@ -1866,7 +1866,7 @@ static gboolean
|
|||||||
update_binding (MetaKeyPref *binding,
|
update_binding (MetaKeyPref *binding,
|
||||||
gchar **strokes)
|
gchar **strokes)
|
||||||
{
|
{
|
||||||
GSList *old_bindings, *a, *b;
|
GSList *old_combos, *a, *b;
|
||||||
gboolean changed;
|
gboolean changed;
|
||||||
unsigned int keysym;
|
unsigned int keysym;
|
||||||
unsigned int keycode;
|
unsigned int keycode;
|
||||||
@ -1878,8 +1878,8 @@ update_binding (MetaKeyPref *binding,
|
|||||||
"Binding \"%s\" has new GSettings value\n",
|
"Binding \"%s\" has new GSettings value\n",
|
||||||
binding->name);
|
binding->name);
|
||||||
|
|
||||||
old_bindings = binding->bindings;
|
old_combos = binding->combos;
|
||||||
binding->bindings = NULL;
|
binding->combos = NULL;
|
||||||
|
|
||||||
for (i = 0; strokes && strokes[i]; i++)
|
for (i = 0; strokes && strokes[i]; i++)
|
||||||
{
|
{
|
||||||
@ -1920,17 +1920,17 @@ update_binding (MetaKeyPref *binding,
|
|||||||
combo->keysym = keysym;
|
combo->keysym = keysym;
|
||||||
combo->keycode = keycode;
|
combo->keycode = keycode;
|
||||||
combo->modifiers = mods;
|
combo->modifiers = mods;
|
||||||
binding->bindings = g_slist_prepend (binding->bindings, combo);
|
binding->combos = g_slist_prepend (binding->combos, combo);
|
||||||
|
|
||||||
meta_topic (META_DEBUG_KEYBINDINGS,
|
meta_topic (META_DEBUG_KEYBINDINGS,
|
||||||
"New keybinding for \"%s\" is keysym = 0x%x keycode = 0x%x mods = 0x%x\n",
|
"New keybinding for \"%s\" is keysym = 0x%x keycode = 0x%x mods = 0x%x\n",
|
||||||
binding->name, keysym, keycode, mods);
|
binding->name, keysym, keycode, mods);
|
||||||
}
|
}
|
||||||
|
|
||||||
binding->bindings = g_slist_reverse (binding->bindings);
|
binding->combos = g_slist_reverse (binding->combos);
|
||||||
|
|
||||||
a = old_bindings;
|
a = old_combos;
|
||||||
b = binding->bindings;
|
b = binding->combos;
|
||||||
while (TRUE)
|
while (TRUE)
|
||||||
{
|
{
|
||||||
if ((!a && b) || (a && !b))
|
if ((!a && b) || (a && !b))
|
||||||
@ -1955,7 +1955,7 @@ update_binding (MetaKeyPref *binding,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
g_slist_free_full (old_bindings, g_free);
|
g_slist_free_full (old_combos, g_free);
|
||||||
|
|
||||||
return changed;
|
return changed;
|
||||||
}
|
}
|
||||||
@ -2090,7 +2090,7 @@ meta_prefs_add_keybinding (const char *name,
|
|||||||
pref->name = g_strdup (name);
|
pref->name = g_strdup (name);
|
||||||
pref->settings = g_object_ref (settings);
|
pref->settings = g_object_ref (settings);
|
||||||
pref->action = action;
|
pref->action = action;
|
||||||
pref->bindings = NULL;
|
pref->combos = NULL;
|
||||||
pref->add_shift = (flags & META_KEY_BINDING_REVERSES) != 0;
|
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;
|
||||||
@ -2254,7 +2254,7 @@ meta_prefs_get_window_binding (const char *name,
|
|||||||
|
|
||||||
if (pref->per_window)
|
if (pref->per_window)
|
||||||
{
|
{
|
||||||
GSList *s = pref->bindings;
|
GSList *s = pref->combos;
|
||||||
|
|
||||||
while (s)
|
while (s)
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user