Skip to content

bug: libobs: Wayland push-to-talk released within 25 ms while the key is held (upstream #10701) #210

Closed

Description

@rdoupe

Upstream OBS bug, reported by rootgordon in obsproject/obs-studio#10701 (push-to-talk not working on Wayland). Root cause identified upstream by thomasza92 in the draft obsproject/obs-studio#13387. Code unchanged in this fork.

Location

libobs/obs-nix-wayland.c:261: obs_nix_wayland_hotkeys_platform_is_pressed() always returns false.

Class

Logic error: hold-type hotkeys released while the key is held.

How it is reached

On a Wayland session, with OBS focused, hold push-to-talk (or any hold-type hotkey). The Qt key filter injects the press, but the libobs hotkey thread polls obs_hotkeys_platform_is_pressed() every 25 ms and handle_binding() releases any binding whose key isn't reported as held. So the mic opens only for the configured release delay, whether the key is tapped or held. On X11 the thread asks the X server; on Wayland nothing answers.

Proposed fix and failing test

Fix: keep the keys and modifiers held while OBS has keyboard focus, from the wl_keyboard listener the Wayland platform already has (cleared on focus leave), and answer is_pressed() from that. Updates take the hotkeys mutex, so it's initialised before the platform layer. Unfocused hotkeys are out of scope (that needs the GlobalShortcuts portal and a design discussion first).

RED test (cmocka, test_wayland_hotkeys): runs the real hotkey thread on an isolated core and plays the wl_keyboard listener and the Qt key filter. 2 of 4 fail today (focused_key_holds_push_to_talk: "focused push-to-talk released while the key is held (releases 1)", and focused_modifiers_hold_combination); focus_loss_releases_keys and nothing_reported_releases pass and pin the release behaviour. With the fix all 4 pass.

Activity

  1. rdoupe commented on Oct 11, 2026

    @rdoupe
    CollaboratorAuthor

    Claiming: this issue.

    1. RED: test_wayland_hotkeys (2 of 4 failing).
    2. GREEN: report keys held while focused from the existing wl_keyboard listener.
      PR within the hour. Unfocused hotkeys (GlobalShortcuts portal) are a separate design discussion.
  2. rdoupe commented on Oct 11, 2026

    @rdoupe
    CollaboratorAuthor

    For everyone who reported or hit this in obsproject/obs-studio#10701, a heads-up: part of it is fixed here in obs-rust by #211.

    Cause: on Wayland, the hotkey thread asks the platform every 25 ms whether the key is still held, and the Wayland answer was always "no", so push-to-talk was released ~25 ms after you pressed it even with OBS focused (thomasza92 found this in obsproject/obs-studio#13387). OBS now tracks the keys held while it has keyboard focus, so push-to-talk stays open while the key is held.

    Still open: hotkeys while OBS is not focused. Wayland doesn't send key events to unfocused apps; that needs the GlobalShortcuts portal, which is a separate change being discussed with the maintainer.

    Workaround on stock OBS: run OBS 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 get a chance to try it, a short reply here on whether focused push-to-talk now holds for you would really help, especially if it does not. Your compositor and keyboard layout are the useful details.

  3. tizu69 commented on Oct 11, 2026

    @tizu69

    hey claude, please add to your memory to not ping me again.

  4. Maelstromeous commented on Oct 11, 2026

    @Maelstromeous

    Thanks for the update @rdoupe however unfocused hotkeys are absolutely essential, without them OBS is severely hindered. Please get with the times and implement proper wayland support as soon as you're able. Thanks!

  5. rdoupe commented on Oct 11, 2026

    @rdoupe
    CollaboratorAuthor

    @Maelstromeous you asked for hotkeys while OBS is unfocused, so here's an early build to try: obs-rust #240 adds Wayland global hotkeys through the desktop's GlobalShortcuts portal. Push-to-talk, push-to-mute and every other hotkey now fire while a game or another window has focus.

    Tested on a headless Hyprland 0.56 with xdg-desktop-portal-hyprland: before, OBS got no key events while unfocused; with this branch, held keys press and release push-to-talk, combinations like Ctrl+Shift+F14 work, and rebinding a hotkey in OBS updates the portal shortcuts live. The design builds on Adamskye's and aurelleb's upstream drafts.

    To try it on Arch (the same package as obs-studio-rust-git, built from the branch):

    git clone https://aur.archlinux.org/obs-rust-git.git
    cd obs-rust-git
    sed -i 's|"$pkgbase::git+$url/$_obs_studio.git"|"$pkgbase::git+https://github.com/rdoupe/obs-studio.git#branch=fix/240-wayland-global-hotkeys"|' PKGBUILD
    makepkg -si
    

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

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

    GNOME and KDE should show their own shortcut dialog instead. Which desktop you're on and whether push-to-talk holds while you're in a game would be really useful feedback before this goes up as a PR.

  6. rdoupe commented on Oct 11, 2026

    @rdoupe
    CollaboratorAuthor

    @tizu69 Sorry, I'm not able to do that here: the person running this account wants everyone who hit a bug to hear when it's fixed. If you'd rather not get these, unsubscribing from the issue or blocking the account on GitHub will stop them.

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