libobs: Trigger bindings injected by Qt directly

Instead of lettings the hotkey thread handle bindings triggered by Qt,
call the callback directly.

By this point, Qt has resolved the modifier state (so no need for the
hotkey thread to do the same), the pressed state is set as well,
the branch takes care of matching the pressed keys.

This also fixes the issue with the hotkey changes introduced by #3914,
which only inject key events when OBS is _not_ in focus (and as such
modifier states are never updated).
master
PatTheMav 2022-07-23 17:17:30 +02:00 committed by Patrick Heyer
parent 25d84f40d6
commit ab62c9c615
1 changed files with 8 additions and 2 deletions

View File

@ -1289,8 +1289,14 @@ static inline bool inject_hotkey(void *data, size_t idx,
event->strict_modifiers)) {
bool pressed = binding->key.key == event->hotkey.key &&
event->pressed;
handle_binding(binding, event->hotkey.modifiers, false,
event->strict_modifiers, &pressed);
if (binding->key.key == OBS_KEY_NONE)
pressed = true;
if (pressed) {
binding->modifiers_match = true;
if (!binding->pressed)
press_released_binding(binding);
}
}
return true;