input: Fix modifier keys getting stuck if depressed during config reload (#7486)

The problem:
    If `input:numlock_by_default = true`, depressed mods will get stuck
    on config reload; this takes effect after some other mod is pressed.

This restores 0.41.2 behavior, with the exception that selected keyboard
layout is preserved.

918d8340af/src/managers/input/InputManager.cpp (L993-L1002)
This commit is contained in:
MahouShoujoMivutilde 2024-08-23 22:35:52 +03:00 committed by GitHub
parent df4f222482
commit a3b75559b3
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 2 additions and 1 deletions

View File

@ -119,7 +119,8 @@ void IKeyboard::setKeymap(const SStringRuleNames& rules) {
if (IDX != XKB_MOD_INVALID)
modifiersState.locked |= (uint32_t)1 << IDX;
updateModifiers(modifiersState.depressed, modifiersState.latched, modifiersState.locked, modifiersState.group);
// 0 to avoid mods getting stuck if depressed during reload
updateModifiers(0, 0, modifiersState.locked, modifiersState.group);
}
for (size_t i = 0; i < LEDNAMES.size(); ++i) {