Skip to content

libobs: Add global hotkey support on Wayland - #13661

Open
aurelleb wants to merge 2 commits into
obsproject:masterfrom
aurelleb:wayland-vicinae-hotkeys
Open

aurelleb wants to merge 2 commits into
obsproject:masterfrom
aurelleb:wayland-vicinae-hotkeys

Conversation

@aurelleb

@aurelleb aurelleb commented Jul 16, 2026 •

Copy link
Copy Markdown

Description

Edit: updated to support the upstreamed version of the proposed protocol, xx-hotkey-v1

Implements the vicinae hotkey wayland protocol which allows clients such as OBS to bind global shortcuts.

A quick word about the implementation: this protocol is not a raw keyboard hook, and therefore didn't fit the existing shortcut model inside OBS. I'm not fully sure why OBS does this instead of using native APIs to register global shortcuts on other platforms, but I think my adapter is not too bad.

The protocol can return an error when a bind is refused by the compositor, in which case the global trigger will not be honored. Since there was no UI to communicate this kind of thing, I just let it be an error message in the console

Motivation and Context

Currently, there is no good way to bind global shortcuts on wayland environments.

The desktop portal solution is inadequate for most applications as it doesn't allow the client to control its global bindings to the fullest. Due to these limitations it is also not widely implemented.

Some time ago I came up with the vicinae-hotkey protocol which simply mirrors the way global shortcuts work on other desktop platforms such as Windows and macOS. The client is free to bind, rebind, and revoke any global shortcut. The compositor only responsibility is to allow or deny the bind.

This protocol got merged into Hyprland and there is an open PR for the niri compositor as well, two prominent wayland desktops.

The goal is to further the adoption of this protocol by getting more clients to use it. OBS is the main piece of software affected by the lack of proper global shortcuts on most wayland desktops so this would greatly help.

Technically, this would fix #10538

How Has This Been Tested?

Tested on my Gentoo Linux 2.18 machine, with my niri fork as the running Wayland compositor. This can also be tested with Hyprland git but niri is easier to build.

Binding a shortcut in OBS works as it usually does, but also activates when the OBS window is not focused.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)

Checklist:

  • I have read the contributing document.
  • My code has been run through clang-format.
  • My code follows the project's style guidelines
  • My code is not on the master branch.
  • My code has been tested.
  • All commit messages are properly formatted and commits squashed where appropriate.
  • I have included updates to all appropriate documentation.

@tytan652

tytan652 commented Jul 17, 2026 •

Copy link
Copy Markdown
Collaborator

OBS Studio can only rely on Portals (cross-DE and display protocol agnostic) or up-streamed non-ext Wayland protocols.
So for shortcuts, both OBS Studio and Portals needs discussions and works to be done.

@tytan652 tytan652 closed this Jul 17, 2026
@aurelleb

Copy link
Copy Markdown
Author

Can I know why? What is the problem with this solution?

@tytan652

tytan652 commented Jul 17, 2026 •

Copy link
Copy Markdown
Collaborator

Unlike Portals that are DE-agnostic (and display protocol agnostic), your protocol will never spread beyond a few WM there is no point to support this kind of protocol from an application standpoint.

An application should mainly rely on DE-agnostic API and if really needed on Wayland protocols from wayland-protocols repo.

Out-of-focus hotkeys falls upon the portal umbrella since this is outside wayland-protocols scope for desktop applications, both OBS Studio and the Global Shortcut portal needs changes.

Edit: And trying to get around it (portals) is not the proper way long-term wise.

@aurelleb

Copy link
Copy Markdown
Author

Out-of-focus hotkeys falls upon the portal umbrella since this is outside wayland-protocols scope for desktop applications, both OBS Studio and the Global Shortcut portal needs changes

I don't really understand who decided that. The compositor already owns the input so I don't really get why we need portals for this matter. The goal here was to try to change that, as there is, imo, no need for it to be this complicated. Also the portal is probably dead on arrival for OBS because it doesn't let clients rebind their keys freely.

Also, my goal is to push this in as many compositors as possible eventually, and the more support there is for it the stronger the case for an official proposal will be.

Now I get that you may not want OBS to carry the implementation of an experimental protocol, but as I see it it would harm no one and make global shortcuts work out of the box for a significant portion of users already.

@Fenrirthviti Fenrirthviti reopened this Jul 17, 2026
@Fenrirthviti

Copy link
Copy Markdown
Member

I'm opting to reopen this for further comment and discussion, as from where I sit, there hasn't been any meaningful movement on the portals piece for several years at this point, and a less-than-ideal solution is better than just sitting on our hands waiting for something theoretically better to arrive.

@mihawk90

mihawk90 commented Jul 20, 2026 •

Copy link
Copy Markdown
Contributor

I'm not categorically against this, but I do have some concerns with the general approach here.

Reading between the lines in your comments on the Hyprland and Niri PRs, trying to get this merged sounds like a tactic to eventually leverage the inclusion here for an upstream proposal to wayland-protocols, and that just seems backwards to me.

My goal would be to get it into major standalone compositors (mostly hypr+niri) then turn it into an official wp one. If it gets upstreamed I'm going to PR client-side implementations for popular software that have broken global shortcut support.

Not starting with wp because I don't want it to stall forever
-- source

(Ignoring here that filing this PR goes against that plan too, because it's not in Niri yet, and it was filed before it got upstreamed to wayland-protocols)

And I'm sorry to break it to you, even though Hyprland is flavor of the month, the market share of it and Niri combined is tiny. Even moreso for users that also use OBS to the extent they require GHK support. As someone who's hanging around #linux-support way too much, I can't remember the last time we had someone ask for GHK support on Hyprland, and I don't remember having one for Niri at all.

So even if this gets merged, I doubt that is going to give you any kind of traction for a wayland-protocols proposal.

What you should be focusing on is trying to get this into Plasma and/or GNOME, or even COSMIC, because that is where the majority of users is (especially ones coming directly from Windows that already have extensive setups and require GHK support). But I suspect you know as well as I that that is unlikely to happen unless there is an official protocol (you might have luck with Plasma, but I don't see it happening for GNOME).

To be clear, my concern is not with the way this functionally works, but with the why this should be merged and the general approach of standardising the protocol.

Let's be ultra optimistic and say that by some miracle both Plasma and GNOME merge your protocol as ext or even xx. But then... what happens if your upstream proposal is ultimately rejected and the relevant implementations removed from both? Now OBS and whatever other applications you submit PRs to have a bunch of dead code and break user workflows with no fault of ours.

We are the ones that will ultimately get the support requests. We tell users this was never a standardised protocol. Now either they question why we merged a non-standard implementation in the first place, or they run to their DE's bugtracker and file a complaint that'll either get closed or receive a bunch of pointless comments before being closed.

We have seen harassment campaigns in the wayland-protocol space before, and I'm not sure that OBS wants to be a source of it.


I do think the approach of how the hotkey assignment is handled makes sense, and in fact it's something that I proposed myself in the OBS dev channel a while ago during a discussion about the obs-wayland-hotkeys plugin and the shortcomings of the current portal design:

Does the portal provide ways for the application to suggest hotkeys or provide defaults?


You can suggest a combination, but the DE impl has always the final say and can ignore it.
-- 16/11/2025, 17:12

From my understanding your protocol essentially adds a feedback mechanism to let the application know that the assignment was denied, plus a reason why. And also of course a way for bilateral revocation of assignments. Which all of course makes sense. But implementation should come after standardisation (or rather during the standardisation process as xx implementations).

@WizardCM WizardCM added kind/feature Functionality or other elements that the project doesn't currently have. platform/linux Categorizes issue or PR as affecting Linux specifically labels Jul 20, 2026
@aurelleb

Copy link
Copy Markdown
Author

trying to get this merged sounds like a tactic to eventually leverage the inclusion here for an upstream proposal to wayland-protocols, and that just seems backwards to me.

Yes that is correct. I don't think it's that backwards though, as far as I can tell this is how a lot of the current ext protocols came to be. wlr-data-control started as a downstream wlroots protocol, got adopted by compositors and clients over the years until it became a de facto standard (even KWin implemented it, years before any standardization), and then got upstreamed as ext-data-control nearly unchanged. wlr-screencopy -> ext-image-copy-capture is a similar story. Protocols that already have implementations and users end up standardized, the ones that have neither tend to stall for years.

(Ignoring here that filing this PR goes against that plan too, because it's not in Niri yet, and it was filed before it got upstreamed to wayland-protocols)

I agree, I'm going to file an official proposal very soon. At the time I made the initial Hyprland PR, I didn't really expect it to get merged so fast.

So even if this gets merged, I doubt that is going to give you any kind of traction for a wayland-protocols proposal.

I disagree here, for the same reason as above. What got those wlr protocols upstreamed is that clients and compositors were already shipping them. OBS is probably the most cited application for this whole problem (#10538 has been open for years), and for what it's worth, ext inclusion formally requires at least one open-source client and one open-source server implementation. So a client implementation like this one is literally part of the requirements for the proposal, not a way around it.

what happens if your upstream proposal is ultimately rejected and the relevant implementations removed from both?

If it gets to xx then implementations during that phase are how the experimental namespace is supposed to work in the first place, and removal on rejection is a known cost of that model. I'm fine being held responsible for that here:

  • the implementation is isolated in the wayland hotkey path, removing it is a small revert
  • I will maintain this code and handle issues related to it for as long as it's in tree
  • if the proposal gets rejected for good, I will submit the removal PR myself

Worst case, a feature that currently doesn't work at all goes back to not working.

What you should be focusing on is trying to get this into Plasma and/or GNOME, or even COSMIC

That is the plan eventually. For GNOME I agree it realistically only happens after upstream (they don't even implement most ext). But Plasma and COSMIC have adopted protocols early before when the demand was there, KWin shipping wlr-data-control being one example, and demand is exactly what client adoption like this demonstrates. In the meantime users on compositors that already ship the protocol get working shortcuts today, instead of waiting 5 more years for basic features.

From my understanding your protocol essentially adds a feedback mechanism to let the application know that the assignment was denied, plus a reason why.

Yes, the idea is that the client always knows what is happening with its bindings. The "you can suggest a shortcut but the DE may silently ignore it" thing from the portal means OBS can't even tell the user why their hotkey is dead.

@mihawk90

Copy link
Copy Markdown
Contributor

Fair enough.

As I said, I'm by no means against this, I just found it a bit odd.

Regardless, about this:

I'm fine being held responsible for that here:

  • the implementation is isolated in the wayland hotkey path, removing it is a small revert
  • I will maintain this code and handle issues related to it for as long as it's in tree
  • if the proposal gets rejected for good, I will submit the removal PR myself

Worst case, a feature that currently doesn't work at all goes back to not working.

My main point wasn't about the code issue, reverting the PR commit is trivial. I'm mostly concerned about the support aspect, because it's our Discord and Forums that will get the brunt of it.

At the end of the day it's not my call to make (I'm not part of the OBS team), I'm just raising the concern for consideration.

@aurelleb

Copy link
Copy Markdown
Author

I created the official proposal here: https://gitlab.freedesktop.org/wayland/wayland-protocols/-/merge_requests/525

@Conan-Kudo

Copy link
Copy Markdown
Contributor

Fair enough.

As I said, I'm by no means against this, I just found it a bit odd.

It isn't how it is supposed to work, but it is how it works in practice. It's a lot harder to argue against protocols that have broad adoption than ones that don't.

xx_hotkey_v1 was merged upstream as an experimental protocol and
supersedes vicinae_hotkey_v1.
@aurelleb

aurelleb commented Sep 11, 2026 •

Copy link
Copy Markdown
Author

The protocol got merged as xx-hotkey-v1.

I updated this PR accordingly. The revised version of the protocol adds explicit support for modifier keys and mouse button triggers.

@mihawk90

Copy link
Copy Markdown
Contributor

The protocol got merged as xx-hotkey-v1.

That thread was an... interesting read 🙃

@Zamundaaa

Copy link
Copy Markdown

For the record, we don't have any plans to implement that protocol in KWin. Rather than solving the problems the global shortcuts portal has and being universally better than it, it just makes a very different set of tradeoffs, and those tradeoffs conflict with our normal global shortcuts system.

Just to be clear, this isn't about protocol vs. portal or whatever (since the wayland-protocols discussion went there quite a lot, when the transport mechanism of the communication is quite irrelevant here), the protocol just has a lot of problems compared to the portal, like

  • being limited to generic key combinations, a limitation we're working hard to get away from in our shortcuts implementation
  • removing the ability for the user to customize global shortcuts (on a system level)
  • making conflict resolution worse (just yes/no vs. our UI showing which shortcut is in conflict)
  • being limited to temporary shortcuts that go away once the app quits, which also makes the conflict resolution problem much worse
  • being limited in terms of permissions. At most the system can prompt "always / never allow" once for an app, but anything more granular isn't possible

If there's interest in making global shortcuts work in OBS, we'd be happy to help improving the portal though.

@aurelleb

Copy link
Copy Markdown
Author

@Zamundaaa it would have been great to discuss this on the freedesktop thread directly, instead of voicing those concerns just now 😓

making conflict resolution worse (just yes/no vs. our UI showing which shortcut is in conflict)

being limited in terms of permissions. At most the system can prompt "always / never allow" once for an app, but anything more granular isn't possible

I don't really understand how the protocol is preventing that? You can implement granular permissions with this as well. You know the app_id and the bind that is requested.

being limited to temporary shortcuts that go away once the app quits, which also makes the conflict resolution problem much worse

That's a real trade off, polluting the shortcut namespace permanently is also annoying and will require manual cleanup from the user at some point. Reservations dying with the client have this benefit. For conflicts, as said above there is nothing preventing the compositor from assisting with that, and with this protocol the client is also aware of it and can show relevant UX to the user.

being limited to generic key combinations, a limitation we're working hard to get away from in our shortcuts implementation

99% of the time that is what we want, most apps that are broken today would not suffer from this. I reworked the protocol in order to leave room for other kinds of bindings if necessary, so I don't see that as a hard blocker.

removing the ability for the user to customize global shortcuts (on a system level)

This one is true in the sense that currently there is no mechanism allowing the compositor to change the binding and let the client know about it. If that's really needed it could be implemented, though.

@Zamundaaa

Copy link
Copy Markdown

it would have been great to discuss this on the freedesktop thread directly

Maybe I should've, but other people were already bringing forward similar concerns and I'm not actually interested in improving that protocol proposal as long as the underlying principles (that the app chooses a strictly specified trigger without user interaction, and that shortcuts are ephemeral) stay the same.

I don't really understand how the protocol is preventing that? You can implement granular permissions with this as well. You know the app_id and the bind that is requested.

The only thing the system could do with that is throw up a contextless prompt for every single requested bind asking the user if it's okay.

If that sort of UX would be acceptable, you could just do the same thing with the global shortcuts portal in better, because it can bundle the request for many shortcuts into a single prompt and it doesn't have any of the other limitations.

polluting the shortcut namespace permanently is also annoying and will require manual cleanup from the user at some point

Having the app have a secret list of which shortcuts are reserved does the opposite of helping with that. The user can accidentally assign conflicting shortcuts just by not having apps run at the same time.

When the conflicts happen, instead of the user being able to press "reassign" on a prompt like this:
Screenshot_20260911_071831

Or being able to delete all shortcuts of the app (or an action set, or whatever) with a simple button press, on app startup they'll get prompted by the app about conflicts, or shortcuts are silently assigned to nothing at all.

Now scale that up to more than one app using the protocol.

For conflicts, as said above there is nothing preventing the compositor from assisting with that, and with this protocol the client is also aware of it and can show relevant UX to the user.

Not really, because the shortcuts aren't permanent. To make that work even somewhat well, every app would need to be running all the time.

99% of the time that is what we want, most apps that are broken today would not suffer from this. I reworked the protocol in order to leave room for other kinds of bindings if necessary, so I don't see that as a hard blocker.

It might be what you want, but not what I or other Plasma developers want. Keeping the protocol open to adding more application-controlled triggers is also just not good or flexible enough.

Think about all the non-keyboard triggers a user may want to use: macro keyboards, touchpad swipe, touchpad pinch, modifier key + touchpad gestures, extra mouse buttons, modifier key + mouse scroll, stroke gestures, touchscreen swipe, touchscreen edge swipe, touchscreen pinch, gamepad buttons, foot pedals, eye tracking, hand gestures (with the 3D IR camera in laptops), door sensors, any smart home integration really, you name it.

Even just the more common ones of those is not something I'd ever expect any single app to handle, let alone every application in the ecosystem.

@mihawk90

mihawk90 commented Sep 11, 2026 •

Copy link
Copy Markdown
Contributor

The user can accidentally assign conflicting shortcuts just by not having apps run at the same time.

In my eyes that is a good thing though? Why would an app that I am not currently using be blocking the assignment of a shortcut for another? If it's 2 applications that I never use together what gives the DE the right to force a different workflow on me? It is nice that the DE warns me, but at minimum the prompt in the screenshot should give me an "assign anyway, I don't care" button, not block double-assignments entirely.
Sure for the launch command in your screenshot it makes sense, but not much else. But even then, what if my intention was to launch 2 applications with a button?

The idea that a shortcut can only be bound to one single action is wild to me anyway. That has long been a critique of the shortcut portal implementation as well. I don't know if the portal requires this or if DEs just decided that's a good idea, and honestly I don't much care either way, because it doesn't make sense.

In the context of OBS (because turns out we are on the OBS repo where this discussion doesn't really belong) it's not unusual to bind the same shortcut to multiple actions. The obs-wayland-hotkeys plugin worked around that by providing some toggle actions, but that is not sustainable. If you want to show or hide multiple sources (or mute/unmute for audio) at a time with the same shortcut, that is still not possible.

Not really, because the shortcuts aren't permanent. To make that work even somewhat well, every app would need to be running all the time.

They don't though. If the application isn't running, there is no conflict, so it needs no resolution. When the app is opened and there are conflicts, that is the time to worry about conflicts.

@Zamundaaa

Copy link
Copy Markdown

It is nice that the DE warns me, but at minimum the prompt in the screenshot should give me an "assign anyway, I don't care" button, not block double-assignments entirely.

The protocol doesn't change anything about that, it just has a bug where in some specific situations two different applications can have conflicting shortcuts while they're not running at the same time.

If you want to be able to assign the same key combination to two shortcuts at the same time, you need to request that from your DE's shortcuts implementation. I don't think there's anything in the way of implementing that in Plasma at least (and if there were such limitations, again, a new protocol wouldn't help).

@AnCarsenat

Copy link
Copy Markdown

@Zamundaaa Thanks, that's helpful. As a user, here's what I'd want from the portal to make it work for OBS:

  1. Duplicate bindings: allow one key on multiple shortcuts, with a conflict warning and an "assign anyway" option instead of a hard block. I've opened a Plasma request for this: https://bugs.kde.org/show_bug.cgi?id=525649
  2. App-proposed bindings: let the app request binding changes through the portal, with a single bundled confirmation prompt like you described. That way OBS could keep its hotkey settings inside the app.
  3. Shortcut sets/apps can set their own keybinds when allowed : let the app switch between sets of shortcuts, so OBS profiles and scene collections keep their own bindings without the user having to rebind everything.

I've opened an issue for (2) and (3) on xdg-desktop-portal: flatpak/xdg-desktop-portal#2142

Would KDE be open to backing these as a portal extension? Feedback on either issue would be very welcome.

@Zamundaaa

Copy link
Copy Markdown

App-proposed bindings: let the app request binding changes through the portal, with a single bundled confirmation prompt like you described

That would limit shortcuts to keyboard combinations again. Apps can suggest default key combinations when first adding shortcuts, but changing them afterwards must go through the system UI.

let the app switch between sets of shortcuts

That @jpetso and I already talked about, and I think it would be pretty useful. Action sets have precedent in other systems like Steam Input and seem to work quite well there, without reducing flexibility.

@aurelleb

aurelleb commented Sep 16, 2026 •

Copy link
Copy Markdown
Author

That would limit shortcuts to keyboard combinations again. Apps can suggest default key combinations when first adding shortcuts, but changing them afterwards must go through the system UI.

This is bad. Most applications expect to be able to change their own bindings, using their own UI. Coupling that to a compositor specific UI just makes it very inconsistent and is a huge burden for app developers. There is no guarantee as to what the compositor UI will support or not. This restricts what the application can do in terms of UX. Also, standalone compositors do not provide any. But I already explained all of that in the freedesktop thread, I'm not going to repeat myself here.

Or being able to delete all shortcuts of the app (or an action set, or whatever) with a simple button press, on app startup they'll get prompted by the app about conflicts, or shortcuts are silently assigned to nothing at all.
Now scale that up to more than one app using the protocol.

In general, I think apps should be able to surface the fact that a given shortcut can't be bound by themselves, so that they can assist the user with the matter the way they want, instead of having to deal with a slightly different experience everywhere.

I think the disagreement mostly comes down to the fact I'm an application developer trying to target every platform while providing a unified experience. The recurring problem on Wayland is that not enough freedom is given to clients, and as a result the answer to a given problem is slightly different everywhere, when there is an answer at all. I want my app to be able to help with things and provide the onboarding I want.

What I'm aiming to do with this protocol is give more responsibility to the clients so that they can have more flexibility.

@AmmoniumX

AmmoniumX commented Sep 20, 2026 •

Copy link
Copy Markdown

I'm just a regular user, but I think that is also an important perspective to consider here.

From @\Zamundaaa:

* removing the ability for the user to customize global shortcuts (on a system level)

As a user, ...I don't want this. Are you sure that is what your users are actually looking for? Sure, if it's a KDE shortcut such as maximizing/minimizing windows I would want it there, but if I want to configure a keybind to start recording with OBS, my first thought on how to do it would be to open OBS and configure their keybinds within their application. I'm not going to open the KDE settings, go to shortcuts, and search for the option to start recording in OBS there. That is how Windows and MacOS do it, so why would Linux be any different? Why would the UIs of cross-platform applications have to handle Linux in any different way? If applications used the portal approach, then there would be a double-confirmation issue where the users sets the shortcut they want on the UI, but then the portal would prompt if they want to add the shortcut. Yes, I do want to add it, I literally just configured that shortcut.

Either way, I agree there should be a way to at least see all the currently registered shortcuts, but nothing about this proposal makes it seem like it would be completely impossible/unfeasable to later add the option for the compositor to modify those shortcuts directly

@myownfriend

Copy link
Copy Markdown

As a user, ...I don't want this. Are you sure that is what your users are actually looking for? Sure, if it's a KDE shortcut such as maximizing/minimizing windows I would want it there, but if I want to configure a keybind to start recording with OBS, my first thought on how to do it would be to open OBS and configure their keybinds within their application.

This isn't an either/or situation. You can't assume that the application is well-behaving. OBS may provide ways to change global shortcuts but that doesn't mean that all applications that use global shortcuts will. Changing or unsetting them on the compositor side would be the consistent option you have.

If applications used the portal approach, then there would be a double-confirmation issue where the users sets the shortcut they want on the UI, but then the portal would prompt if they want to add the shortcut. Yes, I do want to add it, I literally just configured that shortcut.

The portal approach wouldn't ask you if you're sure you want to do that or not. Portals are not UAC prompts on Windows. Instead you would click something in the application to change the hotkey binding and the application will communicate with the portal to prompt the user with a dialog that lets them set the trigger. The whole binding process happens via the portal dialog. There's no need for the application to know what they picked or for the user to go into their DE's settings.

The non-portal approach is that the user clicks something in the application then they press the keybinding. When that happens, the compositor sends that binding to the application only the application to (hopefully) send it right back to the compositor in the form of a request to create a hotkey, and the compositor (hopefully) binds it. The issue is that the application technically doesn't need the user input at all. Just because the user told it to bind to a particular keyboard combo, that doesn't mean that's the one it will send the compositor as part of the request. The application can also lie about the binding that's been set it's up to the application to determine how to handle failed bindings.

@aldobarr

This comment was marked as abuse.

@Fenrirthviti

This comment was marked as off-topic.

@aldobarr

This comment was marked as abuse.

@AmmoniumX

Copy link
Copy Markdown

@myownfriend

The portal approach wouldn't ask you if you're sure you want to do that or not. Portals are not UAC prompts on Windows. Instead you would click something in the application to change the hotkey binding and the application will communicate with the portal to prompt the user with a dialog that lets them set the trigger. The whole binding process happens via the portal dialog. There's no need for the application to know what they picked or for the user to go into their DE's settings.

This is exactly the "dual/split functionality" issue that I was alluding to. The fact of the matter is that the "standard" for applications has been that they are the ones in control for shortcuts. This is true in all other mainstream desktop operating systems, and for a good reason. Imagine videogame keybinds for example, where actions greatly vary depending on which "context" the game is running. It would be completely immersion ruining and non-standard if I was surprised with a generic GNOME or KDE portal prompt when I was trying to change the keybind for opening my inventory in Minecraft, especially since there are many mods and texture packs that are specifically designed to make the GUI screens feel more immersive.

The non-portal approach is that the user clicks something in the application then they press the keybinding. When that happens, the compositor sends that binding to the application only the application to (hopefully) send it right back to the compositor in the form of a request to create a hotkey, and the compositor (hopefully) binds it.

This hasn't been "breaking" behavior in any other OS, so why would it be here? Popular apps with millions of downloads such as Discord, as well as smaller nicher ones, are able to handle this without any major issues.

The issue is that the application technically doesn't need the user input at all. Just because the user told it to bind to a particular keyboard combo, that doesn't mean that's the one it will send the compositor as part of the request. The application can also lie about the binding that's been set it's up to the application to determine how to handle failed bindings.

That is not an "issue", that's a feature. There are many apps where you can download and install "presets" online from other users that already have a specific workflow of hotkeys/keybinds, you just copy paste and those settings get applied to your system as well. You don't explicitly input the exact keybinds you want, you just trust the application to extract them from the desired preset

@mihawk90

mihawk90 commented Sep 21, 2026 •

Copy link
Copy Markdown
Contributor

While I agree with your general argument, this section is disingenuous to say the least:

Imagine videogame keybinds for example, where actions greatly vary depending on which "context" the game is running. It would be completely immersion ruining and non-standard if I was surprised with a generic GNOME or KDE portal prompt when I was trying to change the keybind for opening my inventory in Minecraft, especially since there are many mods and texture packs that are specifically designed to make the GUI screens feel more immersive.

The portal and this protocol are not designed or even intended for in-application shortcuts. They are meant for Global Shortcuts that can be used to trigger actions in the application while the application is not focused.
If that is your regular usecase while playing games, I question how you're playing games. The only scenario where this applies for games is your garden variety multi-boxing and that's not an "average" usecase, and there's usually game-specific tools to do this anyway.


That being said: Again I don't think this PR is the place to discuss the merits of portal vs protocol vs whatever you can think of.
The fact of the matter is the protocol is available as a Wayland protocol. If you want to see it for your compositor, make your argument there. This is not the place for it.

@myownfriend

myownfriend commented Sep 21, 2026 •

Copy link
Copy Markdown

This is exactly the "dual/split functionality" issue that I was alluding to. The fact of the matter is that the "standard" for applications has been that they are the ones in control for shortcuts. This is true in all other mainstream desktop operating systems, and for a good reason. Imagine videogame keybinds for example, where actions greatly vary depending on which "context" the game is running. It would be completely immersion ruining and non-standard if I was surprised with a generic GNOME or KDE portal prompt when I was trying to change the keybind for opening my inventory in Minecraft, especially since there are many mods and texture packs that are specifically designed to make the GUI screens feel more immersive.

This has nothing to do with videos games. Most don't even use global shortcuts. Even if a global shortcuts portal/protocol was generalized into something that supports normal shortcuts as well, nothing would require that the application uses them. Video games could still take keyboard input and remap them internally as they wish.

Also the fact that buttons do different actions in video games depending on the context has very little to do with keybinds. Nothing dictates that an application must only use a keybind to do one thing and the apps internal context is irrelevant.

This hasn't been "breaking" behavior in any other OS, so why would it be here? Popular apps with millions of downloads such as Discord, as well as smaller nicher ones, are able to handle this without any major issues.

I never used the term "breaking" so I don't know what you're quoting. I also wasn't referring to any problem that would happen at an OS level. The problem I described would be app-specific and would apply to ones that are misbehaving do to bugs or something else. I'm describing a problem with the process.

That is not an "issue", that's a feature.

It's not a feature. I know that a lot of people's first intuition is that apps should be able to do anything without push back but that's truly a terrible way to design software.

The reality is that even Windows requires an application to register global hotkeys. They're not treated like normal input and the registration isn't always successful. The application isn't commanding the OS to do anything, it's a request. The reason why it feels like apps can just set whatever keybinds they want is because Windows usually complies and that would be the case for a portal as well.

There are many apps where you can download and install "presets" online from other users that already have a specific workflow of hotkeys/keybinds, you just copy paste and those settings get applied to your system as well. You don't explicitly input the exact keybinds you want, you just trust the application to extract them from the desired preset

I don't see why you think that would cease to be a possibility with a global shortcut portal. You're muddling a lot of things are actually separate issues. If you're not familiar with how these things work internally then you might get the wrong impression of how they work.

That being said: Again I don't think this PR is the place to discuss the merits of portal vs protocol vs whatever you can think of.
The fact of the matter is the protocol is available as a Wayland protocol. If you want to see it for your compositor, make your argument there. This is not the place for it.

Fair enough.

@Fenrirthviti

Copy link
Copy Markdown
Member

Going to make a formal request that comments here stay on-topic to this specific PR, which is providing a solution to a problem. The conversation is important in general to the overall topic of the global shortcuts portals, but, as mentioned this PR is kind of a poor place to voice those opinions as it's unlikely that those in charge will hear them here.

Let's focus on this specific PR and the code, implementation details, and any missing or improperly handled edge cases.

I'm leaving the conversation here as it has been, for the most part, cordial and feels worth preserving for posterity as part of the overall discussion in the ecosystem, but further off-topic discussion will be removed.

@musjj

musjj commented Oct 22, 2026

Copy link
Copy Markdown

Will this be updated to support the recently upstreamed xx-hotkey-v1 protocol?

@mihawk90

Copy link
Copy Markdown
Contributor

Will this be updated to support the recently upstreamed xx-hotkey-v1 protocol?

#13661 (comment)

@mihawk90

mihawk90 commented Oct 24, 2026 •

Copy link
Copy Markdown
Contributor

@myownfriend
Those are all functions within the same application so what would prevent a global shortcut from being bound and the application mapping that to multiple function internally?

I didn't see this when it was posted, but the problem with this is the same the portal already has: It requires an application-side implementation that no other platform requires. You would need a UI that combines various actions to be then assignable via a single shortcut. This is something that neither Windows nor Mac, nor X11 for that matter require. In all of them you can simply assign the same hotkey to all 3 actions and the rest is handled already.
But this is exactly the kind of thing I meant in the sentence before what you quoted:

The obs-wayland-hotkeys plugin worked around that by providing some toggle actions, but that is not sustainable.

To be fair, in this case the same UI could be used on every other platform too, but it is still reinventing the wheel for something that has existed for decades.

However, in the case of OBS multiple profiles or scene collections also complicate this matter. Assignable shortcuts are only listed for the currently loaded profile and scene collection. This means you wouldn't be able to combine multiple actions that would affect different scene collections once they are loaded because at configure time the action simply does not exist.

So for example say you have 2 Scene Collections: SC1 and SC2. Say each SC has 2 scenes, S1 and S2 in both. Now when SC1 is loaded I want to be able to show/hide S2, but when SC2 is loaded I want to show/hide both S1 and S2. When SC2 is loaded, I'd be able to combine both S1 and S2 actions and then assign a shortcut. But I wouldn't be able to combine SC1's S2 action as well, because it isn't loaded and therefore the action doesn't exist.

This is also one of the reasons why the portal is simply not sufficient for OBS' usecase, as was mentioned before and also in #13680. The portal also has other issues with handling profiles/scene collections (mentioned there too), but that's besides the point. Either way, making this work would require a considerable overhaul of how profiles and scene collections are loaded.

With that in mind, @aurelleb how is the situation with this PR? From my understanding this would be supported because setting the shortcuts comes from the application side. But I'm unclear whether all actions would be triggered correctly.

@myownfriend

Copy link
Copy Markdown

I didn't see this when it was posted, but the problem with this is the same the portal already has: It requires an application-side implementation that no other platform requires. You would need a UI that combines various actions to be then assignable via a single shortcut.

The claim was that it would be impossible for an application to map multiple actions to one binding. My point was that a protocol literally can't prevent that because once the application gets sent the event, it can map it to multiple actions internal if it wants. That was all.

This is something that neither Windows nor Mac, nor X11 for that matter require. In all of them you can simply assign the same hotkey to all 3 actions and the rest is handled already.
To be fair, in this case the same UI could be used on every other platform too, but it is still reinventing the wheel for something that has existed for decades.

I personally never like hearing that we must do something one because the Windows/Mac/X11 do it that way. Something can be around for a decades and be lackluster or straight up bad. The way global shortcuts are handled on other platforms, are not by any means comparable to the greatness that is the wheel.

However, in the case of OBS multiple profiles or scene collections also complicate this matter. Assignable shortcuts are only listed for the currently loaded profile and scene collection. This means you wouldn't be able to combine multiple actions that would affect different scene collections once they are loaded because at configure time the action simply does not exist.

This is also one of the reasons why the portal is simply not sufficient for OBS' usecase, as was mentioned before and also in #13680. The portal also has other issues with handling profiles/scene collections (mentioned there too), but that's besides the point. Either way, making this work would require a considerable overhaul of how profiles and scene collections are loaded.

I'm pretty sure everyone that wants to implement this functionality via a portal is open to the idea that the portal needs reworking and I don't think any are pushing the idea that apps should significantly change themselves to adapt to the current portal.

In my case, I'm not suggesting that the existing portal is a perfect solution that is sufficient as-is. One of my issues with xx-hotkey-v1 is that it didn't seem like there was any willingness to think about what might happen if the compositor supported the protocol but denied the binding. Do they imagine the app would try another binding? Is the assumption that compositor would prompt the user? What would it prompt? It doesn't seem like it's made to allow the compositor to ask the user to pick a combination or anything. I think that most of the time, the application would just fall back to its internal non-global shortcut code that just takes Wayland keyboard events.

My personal opinion, whether it's a portal (my preference) or a Wayland protocol, is that global shortcuts should not be a completely separate means of input. An application should be able to register all application shortcuts with the compositor/DE but would be able to request that some of them can be triggered without focus. Then if the compositor denies that shortcut it's "globalness", it will automatically fallback to acting like normal shortcuts. The compositor would be aware of all known bindings in the running applications and it would be able to track, advertise, and manage collisions between all of them. I would also like if shortcuts to be bound to arbitrary input, not just combinations of keyboard keys.

I can imagine a compositor using a mechanism like that to provide the user with something somewhere in it's UI that informs the user that there are global shortcuts active. It might even give them a dropdown that allows the user to temporarily disable some of them or remap them while still keeping the application in the background. Maybe it could allow some of them to be mapped to a button in the desktop's UI. The compositor could even potentially allow the user to override the shortcuts in the other direction and promote normal application shortcuts to global ones.

Windows, MacOS, and X11 don't do things that way, but I don't think that's a problem.

I don't think any part of what I'm proposing would be at odds with having profiles. The arbitrary input thing would need some figuring out but it could be done by having the compositor expose some token to the app that it can store and recall to rebind.

@mihawk90

mihawk90 commented Oct 24, 2026 •

Copy link
Copy Markdown
Contributor

The claim was that it would be impossible for an application to map multiple actions to one binding.

This might have been misunderstood. I wasn't saying that it's not possible at all, what I was saying was in the context of binding the same hotkey to multiple actions on the compositor side. The OBS in-app example was just one usecase where it's actually relevant on this repo. But there are also cases where you'd want to bind the same key to multiple actions in different applications. For example my Microphone source is (well, was on X11) set to push-to-mute using the same key I used in Discord for push-to-talk. That way it was possible to talk to teammates without having my side of the conversation on stream. That is impossible to do with the current implementation on GNOME and KDE because they don't allow a shortcut to bind to multiple actions.

But that gets into the portal argument again which this isn't the place for. The issue is moreso the work required to even make this work as laid out above.

I personally never like hearing that we must do something one because the Windows/Mac/X11 do it that way. Something can be around for a decades and be lackluster or straight up bad.

I generally agree with that. And I didn't say that we "must because they do it that way". I'm saying that sometimes things are around for decades because they just make sense. From an application developer and even from a user perspective it just makes sense to handle things the same way (as close as can be) on all platforms. 3 of the 4 existing platforms already provide this, why do we need an entirely different flow for the last? This protocol provides the missing piece, at least on compositors that implement it.

The fact users are going to be looking for hotkey configuration in the application in question and not buried somewhere in a system menu seems fairly straight forward to me. Whether or not the way Windows/Mac/X11 handle this on the OS level is implemented well or not isn't a concern of the application as long a) the binding "just works" and b) it gets its event. And that is the crux here: it isn't handled well in the portals because it doesn't cater to application needs, nor user needs.

I'm pretty sure everyone that wants to implement this functionality via a portal is open to the idea that the portal needs reworking and I don't think any are pushing the idea that apps should significantly change themselves to adapt to the current portal.

Nothing is keeping us from eventually implementing the portal once it's actually usable for OBS' needs. Nothing is keeping us from shipping both in parallel either. But the reality is that the portal is not there, and likely won't be for a long time given that these concerns are not new and have not been addressed during its standardisation. On the other hand, the protocol is here already.

And as a reminder, if someone wants to use the portal today there is a plugin to do so. There is nothing wrong with using a plugin for your needs, that's what they are intended for. But the plugin has limitations that are the result of the current portal design.

One of my issues with xx-hotkey-v1 is that it didn't seem like there was any willingness to think about what might happen if the compositor supported the protocol but denied the binding.

I feel like that was laid out fairly plainly. The compositor can deny a binding (or even later revoke an existing binding) and the application is being informed about it. What the application does with that information is up to them. As for this PR, the shortcut is getting unset and the reason is logged in the OBS log, so the user can try again. Ideally this would also be shown in the settings UI, but I don't think that was added or I missed it.

An application should be able to register all application shortcuts with the compositor/DE but would be able to request that some of them can be triggered without focus.

That is outside the scope of the portal and this protocol. They both handle global shortcuts only.

I don't think any part of what I'm proposing would be at odds with having profiles.

It is in the way it currently works. See the linked PR in my previous comment. If your proposal is to change the protocol, then you're in the wrong place. We can only work with what exists and not with a hypothetically better solution.

@myownfriend

Copy link
Copy Markdown

This might have been misunderstood. I wasn't saying that it's not possible at all, what I was saying was in the context of binding the same hotkey to multiple actions on the compositor side. The OBS in-app example was just one usecase where it's actually relevant on this repo. But there are also cases where you'd want to bind the same key to multiple actions in different applications. For example my Microphone source is (well, was on X11) set to push-to-mute using the same key I used in Discord for push-to-talk. That way it was possible to talk to teammates without having my side of the conversation on stream. That is impossible to do with the current implementation on GNOME and KDE because they don't allow a shortcut to bind to multiple actions.

That's completely fair.

The fact users are going to be looking for hotkey configuration in the application in question and not buried somewhere in a system menu seems fairly straight forward to me. Whether or not the way Windows/Mac/X11 handle this on the OS level is implemented well or not isn't a concern of the application as long a) the binding "just works" and b) it gets its event. And that is the crux here: it isn't handled well in the portals because it doesn't cater to application needs, nor user needs.

I accidentally got rid of this while trying to reword and shorten my very wordy post but the idea that the application can provide a UI for setting/changing the shortcut isn't something I'm against. In fact I would also expect to set them via the application UI.

However, I think that it's wonky that the way a user sets keybinds through this protocol involves the compositor sending a key combo to an application on behalf of the user just so that the application will hopefully send same key combo right back to the compositor as global hotkey bind request, again on behalf of the user. Of course by that point the compositor can't know if the app is asking on behalf of the user or acting on it's own. That confusion could have been avoided if the application could trigger some process that allows the compositor to handle the complete keybind process. That would probably be in the form of a dialog and I can understand not wanting that process.

That's why I'm suggesting changing the question a little bit. If the question isn't whether or not the the shortcut + binding can exist at all but whether or not the shortcut can be access without focus, then maybe a solution can be worked towards that satisfies Aurelle's and your needs and the wants of the compositors. I feel like that would already

Nothing is keeping us from eventually implementing the portal once it's actually usable for OBS' needs. Nothing is keeping us from shipping both in parallel either. But the reality is that the portal is not there, and likely won't be for a long time given that these concerns are not new and have not been addressed during its standardisation. On the other hand, the protocol is here already.

The protocol is here in the sense that it's been merged into the Wayland protocols as experimental but it hasn't been implemented KDE or Gnome and there doesn't appear to be interest either.

I feel like that was laid out fairly plainly. The compositor can deny a binding (or even later revoke an existing binding) and the application is being informed about it. What the application does with that information is up to them. As for this PR, the shortcut is getting unset and the reason is logged in the OBS log, so the user can try again. Ideally this would also be shown in the settings UI, but I don't think that was added or I missed it.

And I'm in sure in other software it would be made into a normal hotkey.

That is outside the scope of the portal and this protocol. They both handle global shortcuts only.
It is in the way it currently works. See the linked PR in my previous comment. If your proposal is to change the protocol, then you're in the wrong place. We can only work with what exists and not with a hypothetically better solution.

I understand that but the thread as been mostly about disagreements to either approach will little attempt by either side to really acknowledge the concerns of the other. I'm not sure where that discussion would really happen when even the question of whether it should be a Wayland protocol or portal is in dispute.

@aurelleb

Copy link
Copy Markdown
Author

With that in mind, @aurelleb how is the situation with this PR? From my understanding this would be supported because setting the shortcuts comes from the application side. But I'm unclear whether all actions would be triggered correctly.

Yes full control is given to the client so this kind of thing can be done, as long as the compositor doesn't impose a policy that would make e.g double binding impossible.

@mihawk90

Copy link
Copy Markdown
Contributor

I think that it's wonky that the way a user sets keybinds through this protocol involves the compositor sending a key combo to an application on behalf of the user just so that the application will hopefully send same key combo right back to the compositor as global hotkey bind request, again on behalf of the user.

@aurelleb could probably clarify but that's not how I understand the mechanism at all. The request goes from the application to the compositor, the compositor just decides whether or not it binds or denies and sends an appropriate response.
To my understanding the flow is exactly like it is on the 3 other platforms. The key is assigned in OBS and OBS asks the compositor to make it a global shortcut. It doesn't go from the compositor to the application and back.

The protocol is here in the sense that it's been merged into the Wayland protocols as experimental but it hasn't been implemented KDE or Gnome and there doesn't appear to be interest either.

Of course it requires compositor support, that was never in question. But so does the portal if and when it gets a new version addressing the issues that makes it borderline unusable for OBS. How long that's going to take is anyone's guess seeing as there seems to be a fundamental disconnect with what application developers and users actually want. And again, nothing is stopping us from having both, it's not one vs. the other.

And I'm in sure in other software it would be made into a normal hotkey.

Maybe, maybe not. That's up to them and their philosophy, so not really relevant for OBS.

I understand that but the thread as been mostly about disagreements to either approach will little attempt by either side to really acknowledge the concerns of the other.

And the whole discussion was largely off-topic as well. This PR is about the implementation in OBS. If there are concerns about the protocol, or the portal for that matter, they should be raised there. The way I see it the protocol as it stands right now seems to fit into the keybind flow OBS already has.

@myownfriend

Copy link
Copy Markdown

The request goes from the application to the compositor, the compositor just decides whether or not it binds or denies and sends an appropriate response.

Correct. The protocol is just the application talking to the compositor.

To my understanding the flow is exactly like it is on the 3 other platforms. The key is assigned in OBS and OBS asks the compositor to make it a global shortcut. It doesn't go from the compositor to the application and back.

I'm describing the process of how a user would assign a shortcut within an application's UI.

  • The user presses a key combination
  • The compositor sends that key combination to the application
  • The application hopefully sends that same combination back to the compositor in the form of a global hotkey request

Of course it requires compositor support, that was never in question. But so does the portal if and when it gets a new version addressing the issues that makes it borderline unusable for OBS.

Yes, I'm bring up compositor support because clearly this PR is going nowhere because it's pushing an implementation of a feature that the more popular compositors don't want to implement.

How long that's going to take is anyone's guess seeing as there seems to be a fundamental disconnect with what application developers and users actually want.

Yes I agree, and yet some of those app developers seem to feel that they know how users want to use their software better than the user's do. On the discussion in the Wayland protocol git, there were users, toolkit developers, and compositor developers expressing the kinds of things they want to do be able to do with global shortcuts and shortcuts in general and many of them. They were largely ignored by a few app developers who felt their opinions mattered more.

And the whole discussion was largely off-topic as well. This PR is about the implementation in OBS. If there are concerns about the protocol, or the portal for that matter, they should be raised there.

Then the discussion should probably just be ended here.

The way I see it the protocol as it stands right now seems to fit into the keybind flow OBS already has.

Sure but it also leaves very little room to improve on it.

@mihawk90

Copy link
Copy Markdown
Contributor

I'm describing the process of how a user would assign a shortcut within an application's UI.

  • The user presses a key combination
  • The compositor sends that key combination to the application
  • The application hopefully sends that same combination back to the compositor in the form of a global hotkey request

That's what I thought, but I didn't want to assume it because this sounds disingenuous at best. You're describing every application ever because there's no other way to do it unless the application is insane enough to bind to the hardware event directly.

Yes, I'm bring up compositor support because clearly this PR is going nowhere because it's pushing an implementation of a feature that the more popular compositors don't want to implement.

Counterpoint: At least it is an option on the more niche compositors as opposed to nothing at all.

Yes I agree, and yet some of those app developers seem to feel that they know how users want to use their software better than the user's do.

The same can be said about anyone, including some of the Wayland folks. The difference here is that an application developer can have a vision for how they want their software to be used, and users who do not like that workflow can just not use the application. But the same can't be said about the interaction between application and desktop environment. The application doesn't get to chose what environment their users can or should use.

But also I think you misread that sentence. I didn't mean to say a disconnect between application developers vs. users, but rather between application developers and users vs. how the protocol works.
I for my part have not seen a user wanting to handle their global shortscuts hidden in some system settings menu, much like we don't. This idea stemmed from somewhere in the Wayland space, whatever which way that came to be.

@jpetso

jpetso commented Oct 25, 2026 •

Copy link
Copy Markdown

I'm describing the process of how a user would assign a shortcut within an application's UI.

  • The user presses a key combination
  • The compositor sends that key combination to the application
  • The application hopefully sends that same combination back to the compositor in the form of a global hotkey request

That's what I thought, but I didn't want to assume it because this sounds disingenuous at best. You're describing every application ever because there's no other way to do it unless the application is insane enough to bind to the hardware event directly.

The way I read it is that @myownfriend was questioning whether it's the application that really needs to know the key combination first. As an alternative, I imagine a different flow:

  • User presses a button in the app's shortcut settings to assign a new keyboard shortcut.
  • The app asks the compositor to set any keyboard shortcut for the given global shortcut action.1
  • The compositor tells the user to enter a new key combination for the requested global shortcut, perhaps in some kind of overlay effect, immediately listening for keys.2
  • The user presses a key combination, sending it to the compositor first (as opposed to the app first).
  • The compositor immediately assigns that shortcut for the global action, and tells the app about the updated set of assigned shortcuts.
    • If there are conflicts, the compositor can choose to offer alternatives before assigning the shortcut and telling the app.
  • The app shows the keyboard shortcut(s) in its own settings dialog. No "Apply"/"Confirm" action for shortcuts in app settings - the compositor has already assigned it.
  • The compositor can show a non-intrusive notification for additional shortcut settings, e.g. change or add other key combinations / gestures for the same global shortcut (link to open shortcut in system settings app).

This is pretty close to how the global shortcuts portal currently works, with the key difference that:

  1. Only a single shortcut is being requested.
  2. The user doesn't have to click an extra button in the popup compositor window to customize the shortcut. In this flow, the compositor immediately listens for a key combination and sets it.
    • The compositor could show a special overlay to alleviate safety concerns, if necessary.

I'm imagining this as an addition to the existing portal API in the GlobalShortcuts object.

Obviously this is not something that exists today. But perhaps something that would be acceptable to compositor developers, preserving the compositor's flexibility? While also allowing the app-side workflow of "Show current keyboard shortcut(s) -> Press button to modify -> Press keys to assign -> Done".

Footnotes

  1. If keyboard shortcuts were already assigned, the app would request to have one of them replaced specifically. ↩

  2. If the compositor really wants, it can display an extra button for more advanced shortcut assignments right there in that key assignment mode. And also, obviously, a "Cancel" button to avoid assigning a new shortcut. And perhaps also a checkbox to ignore all such app requests in the future, for potential malicious apps. ↩

@mihawk90

mihawk90 commented Oct 25, 2026 •

Copy link
Copy Markdown
Contributor

The flow you're describing makes sense at first glance, but it immediately hits a wall once profiles and scene collections come into play where you have different sets of keybinds for different actions. Possibly also the same keybind for different actions, or different keybinds for the same action.

What you'd need to do in that case is ask the user to rebind every single key unless you want to keep dead actions bound in the compositor that will never get cleaned up.

This is precisely one of the issues why the portal is not serviceable for OBS. You're looking at it from the point of view of setting the keybind for the first time, but that is not the problem OBS faces with the portal (see also the comment in #13680).

The main issue is not with showing the shortcuts, but with setting them in the first place - and doing so from a saved state, not for the first time, i.e. without user interaction. And this is what this protocol allows: requesting a global shortcut from the application side.

Obviously this is not something that exists today. But perhaps something that would be acceptable to compositor developers, preserving the compositor's flexibility?

As noted before, suggestions for improvements on the portal side or entirely new API proposals should be voiced there. There is nothing OBS can do about these suggestions.

@myownfriend

myownfriend commented Oct 25, 2026 •

Copy link
Copy Markdown

The way I read it is that @myownfriend was questioning whether it's the application that really needs to know the key combination first.

You're correct! That's exactly what I was doing. I'm aware that applications have been assigning shortcuts that way for a long time but when you really lay out the order of operations, it doesn't make sense.

As an alternative, I imagine a different flow:

* User presses a button in the app's shortcut settings to assign a new keyboard shortcut.

* The app asks the compositor to set _any_ keyboard shortcut for the given global shortcut action.[1](#user-content-fn-1-3b4738232b1fd8ae53c05d58ebb44385)

* The compositor tells the user to enter a new key combination for the requested global shortcut, perhaps in some kind of overlay effect, immediately listening for keys.[2](#user-content-fn-2-3b4738232b1fd8ae53c05d58ebb44385)

* The user presses a key combination, sending it to the compositor first (as opposed to the app first).

* The compositor immediately assigns that shortcut for the global action, and tells the app about the updated set of assigned shortcuts.
  
  * If there are conflicts, the compositor can choose to offer alternatives before assigning the shortcut and telling the app.

* The app shows the keyboard shortcut(s) in its own settings dialog. No "Apply"/"Confirm" action for shortcuts in app settings - the compositor has already assigned it.

* The compositor can show a non-intrusive notification for additional shortcut settings, e.g. change or add other key combinations / gestures for the same global shortcut (link to open shortcut in system settings app).

This is pretty close to how the global shortcuts portal currently works, with the key difference that:

1. Only a single shortcut is being requested.

2. The user doesn't have to click an extra button in the popup compositor window to customize the shortcut. In this flow, the compositor immediately listens for a key combination and sets it.
   
   * The compositor could show a special overlay to alleviate safety concerns, if necessary.

I'm imagining this as an addition to the existing portal API in the GlobalShortcuts object.

Obviously this is not something that exists today. But perhaps something that would be acceptable to compositor developers, preserving the compositor's flexibility? While also allowing the app-side workflow of "Show current keyboard shortcut(s) -> Press button to modify -> Press keys to assign -> Done".

If I'm understanding this correct, I've actually thought about something like that before. It's kind of like how some emulators set up controllers but with a system-provide prompt that's handling the whole process, right? That definitely solves the communication and trust issues for user-assigned bindings but I couldn't think of a way that would be compatible with apps being able to set default bindings or allow loading profiles of bindings like OBS wants to do.

It also can become a security problem because the app is still in charge of requesting the prompt and if it doesn't it when the user isn't expecting it and they're typing then the user may accidentally input a binding.


That's why I figured it would make sense not to single out global shortcuts and instead look at the problem from the perspective of shortcuts in general and try to figure out where the concerns really lie.

Right now when it comes to normal in-focus application shortcuts, there's no security concerns. Applications can set whatever key combinations they want because the compositor is already insuring the app only gets input that's meant to go to it and the application can do what it wants with that input. So the app having knowledge of the keybind isn't the concern and neither is the apps ability to use it.

It only becomes a security concern when the app asks that it get some kind of regardless of whether or not its focus. If any app could do that whenever it wanted then it can be used maliciously. It's also just a usability problem because even a non-malicious app could have chosen a shortcut that conflicts with shortcut in another open application and theirs no guarantee the application provides a way for the user to change or unset the binding. So it's clear that the app shouldn't have final say on the creation and assignment of the shortcut and that the user should have ways to intervene.

Lastly, I personally don't like the fail state for global shortcut creation on the app side.

That's why I'm suggesting that the app would be able to create a kind of shortcut session/handler object with compositor. This handler object would allow the application to create, set, remove, and change shortcuts at any time while the application is running. It would be able to request that some can be triggered globally but it's not guaranteed that. If the compositor denies the application's request to make a trigger global, it will still act as a shortcut when the application is in-focus.

Since this approach allows the shortcut object to exist and be usable without necessarily being global, it allows for a lot of possibilities.

  • The compositor could decide to prompt the user and asked if the shortcut should be triggered globally.
  • The compositor can accept or deny the request based on whatever criteria it wants to use and inform the user that there are active global shortcuts.
  • The compositor could provide a way for the user to look at all of the active shortcuts controlled by an application and disable/enable/reassign them at their convenience.
  • Applications could request that the user gets presented with a dialog with that information the user. This is useful if the application doesn't want to provide their own UI for changing shortcuts. It could also be used by applications that do provide their own UIs for changing shortcuts as a way for the user to set things as global without having to go into the compositor settings.

and of course it would also give the compositor additional context that it could use to decide if a hotkeys globalness should be accepted or denied.

@myownfriend

myownfriend commented Oct 25, 2026 •

Copy link
Copy Markdown

As noted before, suggestions for improvements on the portal side or entirely new API proposals should be voiced there. There is nothing OBS can do about these suggestions.

You could express whether they would meet OBSs criteria, whether they don't, or if they would work with some changes. Then there would at least be a proposal that people could work towards instead of endless debating which of the two existing solutions are less bad.

But also I think you misread that sentence. I didn't mean to say a disconnect between application developers vs. users, but rather between application developers and users vs. how the protocol works.
I for my part have not seen a user wanting to handle their global shortscuts hidden in some system settings menu, much like we don't. This idea stemmed from somewhere in the Wayland space, whatever which way that came to be.

I don't think the applications devs and users are aligned here. Maybe some are, sure. I also haven't seen users wanting to handle global shortcuts only via a system settings but I don't think any are opposed to that as an option. This protocol is adamant that that can't happen and only the apps can control them. I've seen users say that they want a way to use non-keyboard input (touch/mouse gestures, controllers, and other input devices) and I don't think any user is of the opinion that they shouldn't be able to change a keybinding at all. Both of those things are best handled if the user isn't completely reliant on the application to allow them to do those things.

@mihawk90

mihawk90 commented Oct 25, 2026 •

Copy link
Copy Markdown
Contributor

You could express whether they would meet OBSs criteria, whether they don't, or if they would work with some changes.

What OBS wants/needs has been discussed at length in this (fairly offtopic) discussion already. The protocol meets them, the portal does not. And this is also why I noted before that this is not the place to discuss the merits of portal vs. protocol, but for the actual protocol implementation.

I also haven't seen users wanting to handle global shortcuts only via a system settings but I don't think any are opposed to that as an option.

That's the issue with the portal though? It isn't an option, it is mandatory, ripping users out of the existing UI flow. And this is both annoying for application developers (i.e. OBS) that built that UI and users that are now presented with a completely different UI that varies by DE, or may not exist at all.

This protocol is adamant that that can't happen and only the apps can control them.

This is not true on 2 levels:

  1. The compositor (and therefore the user via a system menu) already has the option to revoke a hotkey outside the application, and the protocol allows them to communicate this revocation to the application (unlike the portal where a binding can just disappear without the application's knowledge), making it possible to actually show this change in the UI.
  2. While the option to change a binding does not currently exist, @aurelleb was open to the idea of adding it if it was to become a requirement:

    This one is true in the sense that currently there is no mechanism allowing the compositor to change the binding and let the client know about it. If that's really needed it could be implemented, though.

Neither of which I would call "adamant that that can't happen".

But either way that again is an improvement request on the protocol side. OBS has nothing to do with that until this was actually added to the protocol and OBS would need to handle it accordingly. But IMHO this is not a hard requirement for OBS right now seeing as it isn't on the 3 other platforms either.

I've seen users say that they want a way to use non-keyboard input (touch/mouse gestures, controllers, and other input devices)

Mouse button support was already added. While the other types are not currently supported, the protocol leaves room to add them:

I reworked the protocol in order to leave room for other kinds of bindings if necessary

This is just not in the first iteration that was already merged, because keyboard (and mouse button) events is what the vast majority of users actually use.

I don't think any user is of the opinion that they shouldn't be able to change a keybinding at all.

In no way did I suggest that either.

@myownfriend

myownfriend commented Oct 25, 2026 •

Copy link
Copy Markdown

What OBS wants/needs has been discussed at length in this (fairly offtopic) discussion already. The protocol meets them, the portal does not. And this is also why I noted before that this is not the place to discuss the merits of portal vs. protocol, but for the actual protocol implementation.

I feel like the way I communicate things isn't particularly compatible with how you understand things. I'm not talking about the portal vs protocol. Both are flawed. I'm trying to propose a solution that would hopefully meet or exceed the needs of those who prefer the portal and those who prefer the protocol. That's why I spent an extensive amount of time describing that solution.

That's the issue with the portal though? It isn't an option, it is mandatory, ripping users out of the existing UI flow. And this is both annoying for application developers (i.e. OBS) that built that UI and users that are now presented with a completely different UI that varies by DE, or may not exist at all.

I'm not saying that the portal is superior to the protocol or vice versa. The portal is built so that applications can't provide their own UI for setting for global shortcuts, the protocol is built so that only the applications UI can be used to setup shortcuts. What I proposed would allow both.

Also I want point out to anyone that may be reading this that the portal does not require that the user go into their system settings to set a global shortcut even though you may get that impression from this conversation. The global shortcut portal allows the application to prompt the user with a dialog that lists all of the apps global shortcut action and allows the user to remove them or change their bindings. It will usually come up by pressing a button in the application's UI.

or may not exist at all.

At least in the situations where it is available, the user will be able to change or disable them. If an application uses the protocol and doesn't provide a UI for the user to change the binding then the user is screwed.

This is not true on 2 levels:

1. The compositor (and therefore the user via a system menu) already has the option to revoke a hotkey outside the application, and the protocol allows them to communicate this revocation to the application (unlike the portal where a binding can just disappear without the application's knowledge), making it possible to actually show this change in the UI.
2. While the option to change a binding does not currently exist, @aurelleb was [open to the idea](https://github.com/obsproject/obs-studio/pull/13661#issuecomment-5637910490) of adding it if it was to become a requirement:

Neither of which I would call "adamant that that can't happen".

I was only talking about changing the bindings outside of the application, though I understand that my wording suggested that revocation would have been impossible, too. I was taking their wording from the protocol thread

"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."

You're right that they said they were open to adding that if it were to become a requirement, but that issue was already brought up to them before the protocol was merged and they didn't ultimately make any changes to the protocol to enable that.

Mouse button support was already added. While the other types are not currently supported, the protocol leaves room to add them:

And what about controllers and other input devices? One of their complaints about the portal is that it tells the application what the binding is but in as a string and not in a machine readable way. If that's a requirement then an application would have to explicitly support a device in order for a user to bind a shortcut to it which is kind of absurd considering the actual input is ultimately abstracted away after the binding.

I reworked the protocol in order to leave room for other kinds of bindings if necessary

This is just not in the first iteration that was already merged, because keyboard (and mouse button) events is what the vast majority of users actually use.

One of the users in the topic wanted to be able to bind shortcuts to specific devices so that they could have a second keyboard that they only use for shortcuts (using single button bindings and bindings with modifiers). That's not the first time I've heard someone express the desire to do that. Wayland currently doesn't even support a way to access individual keyboards so a new protocol would have to be made just to support that and the Wayland global keyboard shortcut would have to be compatible with that. With the "lets not think about it now" mentality, how can someone be sure that the protocol would be able to support something like that?

One of the reasons that I think the protocol isn't a good skeleton or mindset to build off of is because of the lack of consideration for user-configured bindings.

From the perspective of setting app defaults, it makes sense that a mechanism that allows an app to declare global shortcuts would be limited to things like keyboards, mice, and touch because there's no reason for most apps to assume a user has specialized/exotic setups. But user-configured bindings are a very different story. Since the protocol is build around the idea that users will configure shortcuts through the application, it does not distinguish between the two scenarios. In both cases, the application is just trying to create/change a binding.

As a result, this protocol needs to explicitly support more exotic input setups . But if the process for the user-configured binding was offloaded to the compositor, then it wouldn't be limited to the types of input and the device groupings that Wayland or any protocol defines.

I don't think any user is of the opinion that they shouldn't be able to change a keybinding at all.

In no way did I suggest that either.

That wasn't a stand alone statement, it as connected to the sentence after it. I was referencing that the one thing the portal insures that the protocol can't is that the user will be able to change a shortcut. The protocol as it is is designed around the idea that the keybind can only be changed by the user if the application provides a way for the user to do that. So if the application doesn't do that that then user can't change the binding.

I was mentioning that to make point that the portal, despite it's flaws, does insure something that users want.

@jpetso

jpetso commented Oct 25, 2026

Copy link
Copy Markdown

The flow you're describing makes sense at first glance, but it immediately hits a wall once profiles and scene collections come into play where you have different sets of keybinds for different actions. Possibly also the same keybind for different actions, or different keybinds for the same action.

@Zamundaaa previously said that switchable shortcut groups are a desirable feature for portals, so I left that out of my (already long-ish) post under the assumption that these will be available too. I imagine it won't take much more than an extra shortcut-group string identifier to specify in the API for this "assign shortcut" request.

@prajjwal000

prajjwal000 commented Nov 26, 2026 •

Copy link
Copy Markdown

@tytan652 @Fenrirthviti I just wanted to ask whether the protocol implementation is going to be merged. Even if it only works on a few compositors like Hyprland and Niri, having this functionality would be a big improvement for users like me. It doesn't prevent other compositors from adopting it in the future, and it doesn't get in the way if a better portal solution arrives later.

Thanks!

@Fenrirthviti

Copy link
Copy Markdown
Member

This PR, currently, has a lot of discussion and disagreement on it, and no approvals. The code itself has not been reviewed for correctness, which would be the next step if this specific implementation is going to be merged. Until review happens, we cannot say either way if it will be merged or not.

We welcome reviews of the code, and we are keenly aware this is a solution where none currently exists, even if it's not perfect and may be temporary. It's on our radar, but unfortunately isn't a high priority compared to other items the main contributors are focused on right now.

This branch has not been deployed

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

Labels

kind/feature Functionality or other elements that the project doesn't currently have. platform/linux Categorizes issue or PR as affecting Linux specifically

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Global shortcut doesn't work on Wayland