keyboard: Consider additional bindings in uniqueness checks

We now have everything in place to extend the uniqueness check to
consider all bindings of an item rather than just the first one.
With this it is finally possible to set Alt+Tab as binding for
"Switch windows" without keeping the hidden Alt+Tab binding of the
"Switch applications" shortcut ...

https://bugzilla.gnome.org/show_bug.cgi?id=673078
This commit is contained in:
Florian Müllner 2017-06-22 18:40:57 +02:00
parent 2e7c9531fa
commit dd024ae722

View file

@ -105,19 +105,27 @@ static gboolean
find_conflict (CcUniquenessData *data,
CcKeyboardItem *item)
{
CcKeyCombo *combo = item->primary_combo;
GList *l;
gboolean is_conflict = FALSE;
if (data->orig_item && cc_keyboard_item_equal (data->orig_item, item))
return FALSE;
if (data->new_mask != combo->mask)
return FALSE;
for (l = item->key_combos; l; l = l->next)
{
CcKeyCombo *combo = l->data;
if (data->new_keyval != 0)
is_conflict = data->new_keyval == combo->keyval;
else
is_conflict = combo->keyval == 0 && data->new_keycode == combo->keycode;
if (data->new_mask != combo->mask)
continue;
if (data->new_keyval != 0)
is_conflict = data->new_keyval == combo->keyval;
else
is_conflict = combo->keyval == 0 && data->new_keycode == combo->keycode;
if (is_conflict)
break;
}
if (is_conflict)
data->conflict_item = item;