We are currently migrating Bugzilla to GitHub issues.
Any changes made to the bug tracker now will be lost, so please do not post new bugs or make changes to them.
When we're done, all bug URLs will redirect to their equivalent location on the new bug tracker.

Bug 5487 - [PATCH] Implement keyboard grab support for Wayland
Summary: [PATCH] Implement keyboard grab support for Wayland
Status: RESOLVED FIXED
Alias: None
Product: SDL
Classification: Unclassified
Component: video (show other bugs)
Version: HG 2.0
Hardware: x86_64 Linux
: P2 normal
Assignee: Sam Lantinga
QA Contact: Sam Lantinga
URL:
Keywords:
: 5108 (view as bug list)
Depends on:
Blocks:
 
Reported: 2021-01-20 00:28 UTC by Cameron Gutman
Modified: 2021-01-23 01:42 UTC (History)
1 user (show)

See Also:


Attachments
Patch (12.87 KB, patch)
2021-01-20 00:29 UTC, Cameron Gutman
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Cameron Gutman 2021-01-20 00:28:31 UTC
We can use the zwp_keyboard_shortcuts_inhibit_manager_v1 protocol to support keyboard grab (SDL_HINT_GRAB_KEYBOARD) on Wayland just like we do with XGrabKeyboard() for X11.

This is great for remote desktop and similar applications using SDL on Wayland.
Comment 1 Cameron Gutman 2021-01-20 00:29:50 UTC
Created attachment 4681 [details]
Patch

Tested on GNOME 3.38 on Fedora 33.
Comment 2 Sam Lantinga 2021-01-20 18:20:45 UTC
Patch added, thanks!
https://hg.libsdl.org/SDL/rev/b0e13627c656
Comment 3 Cameron Gutman 2021-01-23 01:42:53 UTC
*** Bug 5108 has been marked as a duplicate of this bug. ***