input: do not include consumed modifiers in the set sent to the client

When sending a key escape sequence to the client application, do not
include consumed modifiers.

Fixes part of #376
This commit is contained in:
Daniel Eklöf 2021-02-26 20:54:42 +01:00
parent a8696b567e
commit 6cd72bdee6
No known key found for this signature in database
GPG key ID: 5BBD4992C116573F
2 changed files with 7 additions and 5 deletions

10
input.c
View file

@ -1026,10 +1026,10 @@ key_press_release(struct seat *seat, struct terminal *term, uint32_t serial,
*/
enum modifier keymap_mods = MOD_NONE;
keymap_mods |= seat->kbd.shift ? MOD_SHIFT : MOD_NONE;
keymap_mods |= seat->kbd.alt ? MOD_ALT : MOD_NONE;
keymap_mods |= seat->kbd.ctrl ? MOD_CTRL : MOD_NONE;
keymap_mods |= seat->kbd.meta ? MOD_META : MOD_NONE;
keymap_mods |= mods & ~consumed & shift ? MOD_SHIFT : MOD_NONE;
keymap_mods |= mods & ~consumed & alt ? MOD_ALT : MOD_NONE;
keymap_mods |= mods & ~consumed & ctrl ? MOD_CTRL : MOD_NONE;
keymap_mods |= mods & ~consumed & meta ? MOD_META : MOD_NONE;
const struct key_data *keymap;
if (sym == XKB_KEY_Escape && keymap_mods == MOD_NONE && term->modify_escape_key) {
@ -1113,7 +1113,7 @@ key_press_release(struct seat *seat, struct terminal *term, uint32_t serial,
}
else {
if (mods & alt) {
if (mods & ~consumed & alt) {
/*
* When the alt modifier is pressed, we do one out of three things:
*