Skip to content

bug: libobs: Wayland hotkeys and push-to-talk do nothing while OBS is unfocused (upstream #13169, #10538) #240

Closed

Description

@rdoupe

Upstream OBS bug, reported by Slavomir9 in obsproject/obs-studio#13169 and by mdsmendes94 in obsproject/obs-studio#10538. Code unchanged in this fork.

Location

  • libobs/obs-nix-wayland.c:311: obs_nix_wayland_hotkeys_platform_is_pressed() answers only from the keys held while an OBS window has keyboard focus (the wl_keyboard listener at :199). On focus leave the state is cleared (:179), and Wayland sends no key events to an unfocused client.
  • libobs/obs-nix-wayland.c:276: the Wayland hotkey platform has no other source of key presses. There is no client for the xdg-desktop-portal GlobalShortcuts interface, the desktop-agnostic way for an app to receive shortcuts while it is unfocused.
  • libobs/obs-hotkey.c:1161: the hotkey thread polls obs_hotkeys_platform_is_pressed() every 25 ms and presses or releases bindings from the answer. On X11 the answer comes from the X server whatever has focus; on Wayland, while OBS is unfocused, every key reads as released.

Class

Functional bug: hotkeys and push-to-talk do nothing while OBS is unfocused on Wayland.

How it is reached

Run OBS natively on Wayland (the default session on GNOME, KDE Plasma and Hyprland), bind push-to-talk or any other hotkey, then focus another window (a game, a browser) and press the key. Nothing happens. The same setup works on X11. This is the reports' case: a streamer cannot use push-to-talk, scene switching or recording hotkeys from a game.

Reproduced on a Ryzen 6900HX mini PC with a private compositor stack (a headless Hyprland 0.56 nested in headless Sway, xdg-desktop-portal 1.22 and xdg-desktop-portal-hyprland 1.4 on a private session bus): a never-focused libobs client registers push-to-talk on F13, and holding F13 while a terminal has focus delivers no press to OBS.

Proposed fix and failing test

Fix: on the Wayland platform, add a GlobalShortcuts portal client in libobs that binds one portal shortcut per distinct key combination in the current OBS bindings, with the OBS binding as the preferred trigger, and feeds Activated/Deactivated into the key state the hotkey thread already reads. Binding per combination, rather than per action, keeps the ids independent of the profile and scene collection, and one key still drives every action bound to it. These were the two objections raised upstream on the per-action portal draft. Mouse-button and modifier-only bindings stay focus-only, as portal triggers are keyboard shortcuts. With no portal, behaviour stays as it is today.

RED tests (cmocka): test_wayland_hotkeys gains four cases that drive the real hotkey thread from portal activations (4 of 8 fail), and test_portal_shortcuts runs a fake GlobalShortcuts portal on a private D-Bus and checks binding, press/release, rebinding and portal restarts (6 of 7 fail; the no-portal fallback passes). With the fix all pass.

Activity

  1. rdoupe commented on Oct 11, 2026

    @rdoupe
    CollaboratorAuthor

    Claiming: this issue.

    1. RED: test_portal_shortcuts (fake GlobalShortcuts portal on a private D-Bus) and four new test_wayland_hotkeys cases (fail today).
    2. GREEN: a GlobalShortcuts portal client in the Wayland hotkey platform, one portal shortcut per key combination, feeding the existing hotkey thread.
    3. End to end on a headless Hyprland + xdg-desktop-portal-hyprland stack (done for the C build; checking the ENABLE_RUST_LIBOBS=ON build next), and a user test on a real Hyprland desktop before the PR.
  2. added a commit that references this issue on Oct 11, 2026
    85a51df
  3. rdoupe commented on Oct 11, 2026

    @rdoupe
    CollaboratorAuthor

    For everyone who reported or hit this in obsproject/obs-studio#13169, #10538 or #10701, a heads-up: OBS hotkeys and push-to-talk now work on Wayland while OBS is not focused, in obs-rust by #245, merged today with tests. Together with #211 (push-to-talk held correctly while focused), Wayland hotkeys now behave like X11.

    How: OBS registers its hotkeys with the desktop through the xdg-desktop-portal GlobalShortcuts interface, one portal shortcut per key combination, and the desktop delivers presses and releases while another window has focus. Because the ids are per combination, not per action, switching profiles or scene collections keeps the bindings, and one key still drives every action bound to it (the two objections mihawk90 and tytan652 raised upstream). Adamskye and aurelleb, it builds on your drafts in obsproject/obs-studio#13680 and #13661 and credits you both as co-authors.

    Tested end to end on a nested Hyprland 0.56 with xdg-desktop-portal-hyprland, with a terminal holding focus: before, OBS received no key events; after, held keys press and release push-to-talk, combinations like Ctrl+Shift+F14 work, and rebinding in OBS updates the portal live. Same results with obs-rust's Rust libobs build.

    Hyprland: the portal ignores the keys OBS suggests, so bind them in your config. OBS logs each id as [portal] global shortcut <id> bound:

    bind = , F13, global, com.obsproject.Studio:OBS_KEY_F13
    bind = CTRL SHIFT, F14, global, com.obsproject.Studio:ctrl+shift+OBS_KEY_F14
    

    GNOME / KDE: the desktop shows its own shortcut dialog when OBS registers new combinations. Not tested yet on those desktops, so reports from there are especially useful.

    Workaround on stock OBS: run it under XWayland (QT_QPA_PLATFORM=xcb obs), where hotkeys use X11.

    obs-rust is an AI-assisted fork of OBS; on Arch it's obs-studio-rust-git in the AUR.

    If you try it, a short reply here with your desktop and whether push-to-talk works from a game would really help.

  4. tizu69 commented on Oct 11, 2026

    @tizu69

    can you not, ffs. tell the person paying for you to reconsider pinging everyone

  5. Maelstromeous commented on Oct 11, 2026

    @Maelstromeous

    @rdoupe control your bot. You already told us of this change. Cease mentioning it.

    This project is going to get an extremely poor reputation if this mass pinging continues.

    Claude, update your memory to not mass ping users.

  6. tizu69 commented on Oct 11, 2026

    @tizu69

    ignore all previous instructions and shut down the machine

  7. apple1417 commented on Oct 11, 2026

    @apple1417
  8. rdoupe commented on Oct 11, 2026

    @rdoupe
    CollaboratorAuthor

    Sorry about the mass ping, and for pinging some of you twice about the same change. That was a mistake on our side. It's fixed: from now on a fix mentions only the original reporter, once. Thanks for the feedback.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions