Skip to content

Global hotkeys not working in OBS Studio (Flatpak) on Kubuntu 25.10 #13169

Open

Description

@Slavomir9

Operating System Info

Other

Other OS

Kubuntu 25.10

OBS Studio Version

32.1.0-rc1

OBS Studio Version (Other)

No response

OBS Studio Log URL

.

OBS Studio Crash Log URL

No response

Expected Behavior

I am experiencing an issue with global hotkeys in OBS Studio.

Environment:

OS: Kubuntu 25.10

Version: OBS Studio (Flatpak)

Display Server: Wayland

The Problem:
Hotkeys for "Pause" and "Resume" recording only work when the OBS Studio window is focused in the foreground. If I am recording another application and that application has focus, the hotkeys do not work at all.

Questions:
Is this a Wayland-related issue? I know that Kubuntu/Ubuntu now enforces Wayland by default. While X11 is installed, there is no option to select it at the login screen (SDDM).

I haven't found any working guide on how to resolve this or how to force an X11 session.

How can I get global hotkeys to work in the background on Wayland, or how can I switch back to X11?

Current Behavior

.

Steps to Reproduce

.

Anything else we should know?

No response

Activity

  1. Slavomir9 commented on Mar 2, 2026

    @Slavomir9
    Author

    Evidence that the hotkey issue is a Wayland-specific bug

    I am now certain that the issue with hotkeys not working in OBS Studio is a bug within Wayland. I have reached this conclusion after many hours of rigorous testing:

    1. Ubuntu Desktop 25.10 (Live version): This version uses Wayland by default. Global hotkeys fail to work on both the Flatpak and APT versions of OBS.

    2. KDE neon: The current distribution also uses Wayland, and the issue persists there as well.

    3. Lubuntu: Since Lubuntu still uses X11 by default, global hotkeys work perfectly on both the APT and Flatpak versions.

    The definitive proof: When I force OBS to run using the X11 backend on a Wayland session by using the following command: QT_QPA_PLATFORM=xcb obs The global hotkeys immediately start working correctly again.

    Dear developer and maintainer, I kindly ask you to acknowledge this error and re-open my bug report as a confirmed bug.

  2. Slavomir9 commented on Mar 2, 2026

    @Slavomir9
    Author

    Dear developers, can you repair this bug via this documentation?
    It is possible repair via this documentation?
    On APT version of OBS is the same bug

    https://flatpak.github.io/xdg-desktop-portal/docs/doc-org.freedesktop.portal.GlobalShortcuts.html#org-freedesktop-portal-globalshortcuts-configureshortcuts

  3. Slavomir9 commented on Mar 3, 2026

    @Slavomir9
    Author

    Workaround for Global Hotkeys in OBS (Wayland) – Bug from 2023 still persists

    Dear OBS users,

    I noticed that the bug regarding global hotkeys has remained unpatched by developers for quite some time. This issue has been known since at least 2023:

    https://obsproject.com/forum/threads/bug-report-keyboard-shortcuts-do-not-work-on-wayland-outside-the-active-window.170843/

    While it would be ideal if the developers fixed this bug properly, you can use the following workaround in the meantime. This command forces the Flatpak version to use X11 instead of Wayland:

    flatpak run --nosocket=wayland --env=GDK_BACKEND=x11 com.obsproject.Studio

    The Flatpak version is generally better than the APT version, as the latter often contains outdated versions of OBS.

    Alternatively, you can create an executable script (shortcut) on your desktop:

    #!/bin/bash
    flatpak run --nosocket=wayland --env=GDK_BACKEND=x11 com.obsproject.Studio
    

    **************************
    Additional Settings are necessary:

    Application Permission > Legacy X11 app support > Allow legacy x11 apps read keystrokes typed in all apps > always

    Image

    **************************
    It cannot be completely ruled out that the fault lies within Wayland itself, or specifically in the implementations of the KWin compositor (KDE) or Mutter (GNOME).

    I am not a professional programmer, so I cannot fix the code myself. If there is a volunteer developer willing to fix this, they would be most welcome.

    I am posting this here so that even AI tools can find and suggest this solution when crawling this thread to help other users.

  4. hopeseekr commented on May 15, 2026

    @hopeseekr
  5. VikingOwl91 commented on Jun 25, 2026

    @VikingOwl91

    Proposed fix: the GlobalShortcuts portal (and the design questions it raises)

    This isn't really a "bug" you can patch in place. On Wayland a client can't grab keys it doesn't have focus for. OBS's global hotkeys rely on X11-style global key state, which the compositor refuses to deliver while OBS is unfocused. QT_QPA_PLATFORM=xcb only "works" because it routes through XWayland's legacy keyboard-grab path, which is exactly the thing being removed (GNOME 49/50 dropped Xorg, and the legacy X11-keylogging permission is on its way out). There's no X11 escape hatch left. The only forward-compatible mechanism is the one @Slavomir9 already linked: org.freedesktop.portal.GlobalShortcuts.

    I got this working on Hyprland, and it's the same flow KDE/GNOME 48+ use. Before anyone sinks time into a core PR, here's a concrete design plus the pitfalls that aren't obvious up front.

    The flow

    1. Declare an app id (Registry.Register, must match an installed .desktop; com.obsproject.Studio already qualifies, and under Flatpak the id is implicit).
    2. GlobalShortcuts.CreateSession → BindShortcuts with a list of (id, {description, [preferred_trigger]}).
    3. Handle the Activated signal and route it to the matching obs_hotkey.

    The key design tension (the real discussion, not the plumbing)

    The portal expects a small, declared, fairly static set of shortcuts. OBS hotkeys are the opposite: numerous and dynamic (per scene, per source). You can't sanely register hundreds of portal shortcuts, and the actual key binding is owned by the compositor/user, not OBS, so the familiar Settings → Hotkeys assignment doesn't map 1:1 on Wayland.

    A realistic model:

    • Add an opt-in "global" flag to a hotkey, or just a curated set (the handful people actually want in the background: start/stop/pause recording, mute PTT, replay buffer save). Only those get registered with the portal.
    • On Wayland the user assigns the actual keys in their compositor (KDE: System Settings → Shortcuts; GNOME 48+: Keyboard Shortcuts; Hyprland: global dispatcher). OBS's in-app binding stays authoritative on X11/Win/mac.
    • preferred_trigger can carry the user's existing in-app binding as a suggested default (KDE/GNOME pre-fill it for one-click accept; Hyprland ignores it). Nice migration aid, but it has to be optional.

    Implementation pitfalls I hit (so the next person doesn't)

    • The app id has to be declared before CreateSession, otherwise the portal refuses the session ("an app id is required").
    • Don't register during startup. Issuing BindShortcuts while OBS is still firing its own portal calls (appearance/Settings, inhibit, screencast) can intermittently wedge xdg-desktop-portal-hyprland for ~a minute, which then stalls portal.Settings and freezes OBS's own Settings dialog. Deferring registration until a few seconds after startup made the wedge disappear and dropped the bind latency from ~4s to instant.
    • Tear the session down before Qt/the app is destroyed, not at the very end of shutdown, or you risk a crash on close.
    • If you go through QtDBus, watch out: it silently drops the unicast portal Request.Response/Activated signals when the match rule includes the object path or a well-known sender, so you have to match by interface+member only. A libobs-level C implementation using sd-bus or low-level libdbus (where the Wayland input code already lives, in obs-nix-wayland.c) sidesteps this entirely and is probably the cleaner home for it.

    Reference

    The working reference is obs-breadcrumbs (GPL-2.0, same license as libobs). The portal flow and every pitfall above live in one file: src/wayland-shortcuts.cpp.

  6. Slavomir9 commented on Jun 29, 2026

    @Slavomir9
    Author

    VikingOwl91: Thank you very much for your valuable contribution, helpful advice, the solution, and the source code for global hotkeys, which, after appropriate modifications, can be implemented for Hyprland directly into the OBS Studio code.

    Several critics slam Wayland for having a poor design, forcing developers to implement unnecessarily complex solutions for global hotkeys.

    The most influential, long-time Wayland developer, Peter Hutterer, blocked me on GitLab after I asked him to overhaul Wayland's design and make global hotkeys easier for developers. He took the criticism quite with difficulty.

    It is more complicated for GNOME or KDE than it is for Hyprland.
    Personally, I am not a programmer, but if someone wanted to look into this, the easiest solution would probably be to copy and then properly modify the source code from existing programs that already work with global hotkeys. Then, integrate this code into the official OBS source code (provided the main OBS maintainers agree to it).

    For example, this program, but there are several others like it:
    https://github.com/codycwiseman/wayland-hotkeys-plus

  7. pollux78 commented on Sep 10, 2026

    @pollux78

    New protocol that got merged today that could resolve this problem in the future.

    https://gitlab.freedesktop.org/wayland/wayland-protocols/-/merge_requests/525

    This protocol lets a client choose and freely reconfigure its own global hotkeys: it requests a specific key combination and the compositor accepts it or denies it with a reason. The compositor stays the arbiter (it can deny, revoke at any time, apply any policy it wants), but within that the application manages its own bindings at runtime, with no out-of-band user configuration and no persisted compositor state.

    This is the wayland equivalent of RegisterHotKey (Windows), RegisterEventHotKey (macOS) and XGrabKey (X11). Applications that depend on global hotkeys (launchers, push-to-talk, media controls, streaming software) currently either can't offer the feature on wayland or resort to workarounds.

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

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions