mirror of
https://github.com/brl/mutter.git
synced 2024-11-27 10:30:47 -05:00
clutter: Do not latch modifiers on modifier keys
If the user maps eg. Alt+F2 to a pad button, the MetaInputSettings will
send the full Alt press, F2 press, F2 release, Alt release sequence.
However the keycode corresponding to Alt is found in level 1, so the
Shift modifier gets unintendedly latched in addition to the Alt key
press/release pair.
We could probably improve keycode lookup heuristics so level=0 (and
no modifier latching) is preferred, but we can do without it altogether
for modifier keys.
(cherry picked from commit 67aab7c138
)
This commit is contained in:
parent
1b78ca8c5e
commit
d9cc8530ec
@ -147,14 +147,16 @@ clutter_virtual_input_device_x11_notify_keyval (ClutterVirtualInputDevice *virtu
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (key_state == CLUTTER_KEY_STATE_PRESSED)
|
if (!_clutter_keymap_x11_get_is_modifier (keymap, keycode) &&
|
||||||
|
key_state == CLUTTER_KEY_STATE_PRESSED)
|
||||||
clutter_keymap_x11_latch_modifiers (keymap, level, TRUE);
|
clutter_keymap_x11_latch_modifiers (keymap, level, TRUE);
|
||||||
|
|
||||||
XTestFakeKeyEvent (clutter_x11_get_default_display (),
|
XTestFakeKeyEvent (clutter_x11_get_default_display (),
|
||||||
(KeyCode) keycode,
|
(KeyCode) keycode,
|
||||||
key_state == CLUTTER_KEY_STATE_PRESSED, 0);
|
key_state == CLUTTER_KEY_STATE_PRESSED, 0);
|
||||||
|
|
||||||
if (key_state == CLUTTER_KEY_STATE_RELEASED)
|
if (!_clutter_keymap_x11_get_is_modifier (keymap, keycode) &&
|
||||||
|
key_state == CLUTTER_KEY_STATE_RELEASED)
|
||||||
clutter_keymap_x11_latch_modifiers (keymap, level, FALSE);
|
clutter_keymap_x11_latch_modifiers (keymap, level, FALSE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user