-
Notifications
You must be signed in to change notification settings - Fork 927
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Add support for inhibiting system shortcuts #2776
Comments
Implementation for rust-windowing#2776, on Wayland currently only. Wayland implementation should be done more cleanly, needs X11 and any other applicable platforms, documentation etc.
Implementation for rust-windowing#2776, on Wayland currently only. Wayland implementation should be done more cleanly, needs X11 and any other applicable platforms, documentation etc.
The API itself looks fine, so I don't have any issues implementing it. I'd assume it's per top level for each platform, right? As for macOS I know that it's on you whether you do shortcuts or not, I'm not so sure whether you really have global shortcuts on it. |
On Wayland this is per toplevel. And the GDK function works that way too, so on X11 and Win32 it should either work that way, or GDK is able to emulate the same behavior using more generic APIs (I'm not entirely sure how keyboard grabs on X11 work.) |
You can somewhat enable global shortcuts by having items in your menu bar that respond to certain shortcuts. And actually, we have that in the default menu bar (CMD+Q). |
But you can clearly not bind them when you inhibit shortcuts. |
This can be done for Wasm as well, though only in Chromium, with the Keyboard Lock API. |
For reference, the crate global-hotkey does that for some targets (Windows, MacOs, Linux/x11) and could be used as a workaround for people who need it, until this issue is solved. |
A mechanism to inhibit system shortcuts is generally necessary for things like virtual machines, remote desktop, and system shortcut configuration dialogs. This would also be useful for the Winit backend of Smithay, similarly to a VM or remote desktop client.
In GTK4 this is supported with
gdk_toplevel_inhibit_system_shortcuts
, which seems to be supported on Wayland, X11, and Windows. On Wayland this works through the Keyboard shortcuts inhibit protocol.The text was updated successfully, but these errors were encountered: