[mutter] keybindings: Only add multiple keycodes from the same level
- From: Jonas Ådahl <jadahl src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [mutter] keybindings: Only add multiple keycodes from the same level
- Date: Wed, 20 Dec 2017 07:03:12 +0000 (UTC)
commit 44269e6a1dadb643af3a748c2bcca04ac1ab72eb
Author: Jonas Ådahl <jadahl gmail com>
Date: Wed Nov 1 10:53:59 2017 +0800
keybindings: Only add multiple keycodes from the same level
The reason why multiple keycodes could be mapped to a single keysym was
to support having both KEY_FAVORITES and KEY_BOOKMARK map to
XF86Favorites. However, iterating through all layout levels adding all
key codes has severe consequences on layouts with levels that map
things like numbers and arrow. The result is that keybindings that
should only have been added for keycodes from the first level, are
replaced by some unexpected keycode where the same keysym was found on
another level.
An example of this is the up-arrow key and l symbol. Normally you'd find
both the up-arrow symbol and the l symbol on the first level and be done
with it. However, on the German Neo-2 layout, layout level 4 maps the
KEY_E to the l symbol, while layout level 4 maps KEY_E to up-arrow.
Which ever gets to take priority is arbitrary, but for this particular
case KEY_E incorrectly mapped to up-arrow instead of the l symbol,
causing the keyboard shortcut Super+l, which would normally lock the
screen, to trigger the workspace-up (Super+up-arrow) key binding.
https://bugzilla.gnome.org/show_bug.cgi?id=789300
src/core/keybindings.c | 4 +++-
1 files changed, 3 insertions(+), 1 deletions(-)
---
diff --git a/src/core/keybindings.c b/src/core/keybindings.c
index 6a32eed..5c2f8a1 100644
--- a/src/core/keybindings.c
+++ b/src/core/keybindings.c
@@ -350,7 +350,9 @@ add_keysym_keycodes_from_layout (int keysym,
{
xkb_level_index_t layout_level;
- for (layout_level = 0; layout_level < layout->n_levels; layout_level++)
+ for (layout_level = 0;
+ layout_level < layout->n_levels && keycodes->len == 0;
+ layout_level++)
{
FindKeysymData search_data = (FindKeysymData) {
.keycodes = keycodes,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]