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 5490

Summary: [PATCH] Implement inhibiting screensaver on Wayland
Product: SDL Reporter: Cameron Gutman <cameron.gutman>
Component: videoAssignee: Sam Lantinga <slouken>
Status: RESOLVED FIXED QA Contact: Sam Lantinga <slouken>
Severity: normal    
Priority: P2    
Version: HG 2.1   
Hardware: x86_64   
OS: Linux   
Attachments: Patch

Description Cameron Gutman 2021-01-21 03:34:45 UTC
SDL doesn't currently support inhibiting the screensaver on Wayland. This causes the display to go to sleep while playing games with a gamepad on the Wayland backend.

To suspend the screensaver, we'll support both the org.freedesktop.ScreenSaver D-Bus API (like the X11 backend does) and the idle_inhibit_unstable_v1 Wayland protocol for compatibility with most Wayland compositors.
Comment 1 Cameron Gutman 2021-01-21 03:37:29 UTC
Created attachment 4683 [details]
Patch

Tested org.freedesktop.ScreenSaver on GNOME 3.38.3 (which doesn't support idle_inhibit_unstable_v1).

Tested idle_inhibit_unstable_v1 and org.freedesktop.ScreenSaver on KDE Plasma 5.20.8.
Comment 2 Cameron Gutman 2021-01-21 03:39:11 UTC
FYI: The SDL_DBus_Quit() code (and accompanying FIXME) was copied from the X11 backend.
Comment 3 Sam Lantinga 2021-01-23 17:37:18 UTC
Patch added, thanks!
https://hg.libsdl.org/SDL/rev/d4b8ebda48c4