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).
This commit is contained in:
PatTheMav 2022-07-23 17:17:30 +02:00 committed by gxalpha
parent 2b60f04974
commit fa50f64c3c
No known key found for this signature in database
GPG key ID: 470184116E317811

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;