Opened 10 years ago

Closed 10 years ago

Last modified 10 years ago

#8357 closed enhancement (fixed)

add xdg-screensaver support

Reported by: Johnny Walker <johnnyjboss@…> Owned by: sphery
Priority: minor Milestone: unknown
Component: MythTV - General Version: 0.23rc2
Severity: low Keywords: xdg-screensaver
Cc: mtdean@… Ticket locked: no

Description

these will detect the presence of xdg-screensaver (from the xdg-utils package) and use it to suspend and resume the screensaver instead of the existing xscreensaver-x11 support which involves timers and pokings.

Attachments (6)

screensaver-xdg.cpp (3.7 KB) - added by Johnny Walker <johnnyjboss@…> 10 years ago.
screensaver-xdg.h (549 bytes) - added by Johnny Walker <johnnyjboss@…> 10 years ago.
screensaver.cpp_diff (870 bytes) - added by Johnny Walker <johnnyjboss@…> 10 years ago.
screensaver-xdg.2.cpp (3.0 KB) - added by Johnny Walker <johnnyjboss@…> 10 years ago.
corrected tab stops and other misc. items
screensaver.h (818 bytes) - added by Johnny Walker <johnnyjboss@…> 10 years ago.
corrected tab stops and other misc. items
screensaver.2.cpp_diff (870 bytes) - added by Johnny Walker <johnnyjboss@…> 10 years ago.
corrected tab stops

Download all attachments as: .zip

Change History (10)

Changed 10 years ago by Johnny Walker <johnnyjboss@…>

Attachment: screensaver-xdg.cpp added

Changed 10 years ago by Johnny Walker <johnnyjboss@…>

Attachment: screensaver-xdg.h added

Changed 10 years ago by Johnny Walker <johnnyjboss@…>

Attachment: screensaver.cpp_diff added

Changed 10 years ago by Johnny Walker <johnnyjboss@…>

Attachment: screensaver-xdg.2.cpp added

corrected tab stops and other misc. items

Changed 10 years ago by Johnny Walker <johnnyjboss@…>

Attachment: screensaver.h added

corrected tab stops and other misc. items

Changed 10 years ago by Johnny Walker <johnnyjboss@…>

Attachment: screensaver.2.cpp_diff added

corrected tab stops

comment:1 Changed 10 years ago by Johnny Walker <johnnyjboss@…>

My apologies - I knew better on the tabstops and in my eagerness I forgot about that.

This also my excuse/explanation for leaving in my comment re: House.

I've corrected the tabstops and removed some unneeded items from the ScreenSaverXDG class.

To test I run mythfrontend in a window and "watch -n 1 'xdg-screensaver status'" in another and I see that when I enter playback the screensaver is reported to be disabled and when I pause it is enabled.

I feel like the internal variable of m_xdgscreensaverRunning is a misleading name - it actually appears to mean that the xdgscreensaver is available, and since we instantiated this class we've already determined that xdg-screensaver is available. I'm tempted to rename or remove that variable and the checks of it in the disable and restore methods. I left it as it to match the naming in the screensaver-x11 class that I copied to create this one.

comment:2 Changed 10 years ago by sphery

Owner: changed from Isaac Richards to sphery
Status: newaccepted

comment:3 Changed 10 years ago by sphery

Resolution: fixed
Status: acceptedclosed

(In [24559]) Add support for xdg-screensaver from xdg-utils ( http://portland.freedesktop.org/wiki/ ).

This adds a new class ScreenSaverXDG that provides support for enabling/disabling an X11 screensaver using the xdg-screensaver script from xdg-utils. xdg-screensaver basically implements all of the functionality MythTV had implemented in ScreenSaverX11 (and more)--it handles making sure any supported screensaver applications do not activate when not wanted and handles DPMS enabling/disabling--even if no screensaver applications are running. Therefore, ScreenSaverXDG is significantly simpler than ScreenSaverX11. xdg-screensaver currently supports xscreensaver, GNOME screenaver, KDE screensaver, and support for other screensavers can easily be added to the script.

The biggest benefit of using xdg-screensaver is that it is designed to allow safely disabling a screensaver application such that the screensaver state will be restored even in the event that the suspending application crashes. If mythfrontend crashes after suspending the screensaver, xdg-screensaver will notice that the mythfrontend window no longer exists, so it will re-enable the screensaver. Therefore, rather than poke the screensaver once every 50s during playback, as we do with xscreensaver and gnome-screensaver in ScreenSaverX11 (so we never have to disable the screensaver and risk leaving it in the wrong state after a crash), xdg-screensaver allows us to simply "suspend" the screensaver on playback startup and "resume" the screensaver on playback pause/exit/... This means that users on underpowered systems or users affected by the GNOME screensaver issue that causes gnome-screensaver-command to take significant resources on every execution will no longer see playback issues every 50s or so if they have xdg-screensaver installed.

Refs #7291. Fixes #8357 with slightly modified patch from Johnny Walker. Thanks to Johnny for the patch and for the testing.

comment:4 Changed 10 years ago by sphery

(In [24636]) Remove the xdg-screensaver support by reverting [24559].

While the promise of xdg-screensaver is great, it seems that neither distros nor desktop environments have any desire to support it. Users on various distros with various desktop environments using various (including supported and not supported) screensaver applications found that it did not work for them. Until it's properly supported by distros and desktop environments, it's not useful.

Fixes #8443. Refs #8357. Refs #7291.

Note: See TracTickets for help on using tickets.