xwayland: Use correct key for key release events

When a key is pressed the string that should be used in the key event
changes depending on the xkb updated state for composed keys.

The key itself should be not be affected.
This commit is contained in:
David Edmundson 2024-02-28 13:20:32 +00:00
parent b650f55d60
commit 918ac8b27e

View file

@ -244,14 +244,14 @@ void KeyboardInputRedirection::processKey(uint32_t key, InputRedirection::Keyboa
m_xkb->updateKey(key, state);
}
const xkb_keysym_t keySym = m_xkb->currentKeysym();
const xkb_keysym_t keySym = m_xkb->toKeysym(key);
const Qt::KeyboardModifiers globalShortcutsModifiers = m_xkb->modifiersRelevantForGlobalShortcuts(key);
KeyEvent event(type,
m_xkb->toQtKey(keySym, key, globalShortcutsModifiers ? Qt::ControlModifier : Qt::KeyboardModifiers()),
m_xkb->modifiers(),
key,
keySym,
m_xkb->toString(keySym),
m_xkb->toString(m_xkb->currentKeysym()),
autoRepeat,
time,
device);