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 2169 - Screensaver inhibition broken in GNOME 3
Summary: Screensaver inhibition broken in GNOME 3
Status: RESOLVED FIXED
Alias: None
Product: SDL
Classification: Unclassified
Component: video (show other bugs)
Version: HG 2.1
Hardware: x86_64 Linux
: P2 normal
Assignee: Ryan C. Gordon
QA Contact: Sam Lantinga
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-10-21 15:00 UTC by Bastien Nocera
Modified: 2014-03-02 20:01 UTC (History)
2 users (show)

See Also:


Attachments
0001-X11-Add-support-for-fd.o-Idle-Inhibition.patch (6.02 KB, patch)
2013-10-21 15:03 UTC, Bastien Nocera
Details | Diff
0001-X11-Add-support-for-fd.o-Idle-Inhibition.patch (6.92 KB, patch)
2014-01-10 11:05 UTC, Bastien Nocera
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Bastien Nocera 2013-10-21 15:00:05 UTC
The attached patch will fix the problem for GNOME 3, and any desktop environments that implement the specification.
Comment 1 Bastien Nocera 2013-10-21 15:03:19 UTC
Created attachment 1389 [details]
0001-X11-Add-support-for-fd.o-Idle-Inhibition.patch

Add support for the freedesktop.org Idle Inhibition specification,
as per:
http://people.freedesktop.org/~hadess/idle-inhibition-spec/

This makes screensaver inhibition work with GNOME 3 and other
desktop environments that implement the specification.
Comment 2 Ryan C. Gordon 2014-01-07 20:15:19 UTC
Do you know if there's a way to decide if the system has org.freedesktop.ScreenSaver support (without having to parse a bunch of XML through the D-Bus introspection API)?

Ideally, I'd like to know at runtime if we should use the old way or the new way, instead of blasting out both and hoping for the best. Ideally, we don't decide what we should do based on whether session_cookie is zero.

I don't know if that's actually solvable. Otherwise, this patch looks pretty good.

--ryan.
Comment 3 Bastien Nocera 2014-01-08 12:19:07 UTC
(In reply to Ryan C. Gordon from comment #2)
> Do you know if there's a way to decide if the system has
> org.freedesktop.ScreenSaver support (without having to parse a bunch of XML
> through the D-Bus introspection API)?

You don't need to parse XML. The D-Bus call will simply fail if there's no such interface implemented. I can make SDL_dbus_screensaver_inhibit() return a boolean and only "tickle" if that failed.

> Ideally, I'd like to know at runtime if we should use the old way or the new
> way, instead of blasting out both and hoping for the best. Ideally, we don't
> decide what we should do based on whether session_cookie is zero.
> 
> I don't know if that's actually solvable. Otherwise, this patch looks pretty
> good.

If the above is OK with you, I can make the changes.
Comment 4 Bastien Nocera 2014-01-10 11:05:57 UTC
Created attachment 1518 [details]
0001-X11-Add-support-for-fd.o-Idle-Inhibition.patch

The only thing I'm missing is a good application description. We currently have "My SDL application" which I guess is better than nothing, but another identifier of any sort would be useful.
Comment 5 Ryan C. Gordon 2014-03-02 20:01:28 UTC
This patch is now https://hg.libsdl.org/SDL/rev/fee216d949e3, thanks!

I'm planning to add an application metadata API at some point, which will help with the "My SDL application" string. For now, it's good enough.

--ryan.