Opened 13 years ago

Closed 12 years ago

Last modified 12 years ago

#3652 closed patch (fixed)

Gnome Screensaver support

Reported by: Petr Stehlik <pstehlik@…> Owned by: Anduin Withers
Priority: minor Milestone: unknown
Component: mythtv Version: unknown
Severity: medium Keywords:
Cc: Ticket locked: no

Description

Gnome Screensaver support - very simple, almost verbatim copy of xscreensaver support. Choose one of the two patches - cpp.diff is simpler but I got unsure whether it's OK to check the flag inside of the slot (don't know anything about slots) so I created another patch with a separate slot (cpp+h.diff).

There is one change that seems unnecessary - shortening the default invocation time from 60 to 50 seconds (if none is configured in "xscreensaverInterval"). The reason for this is that minimal screensaver time in Gnome can be set to 1 minute (I do have set it to 1 minute) and the screensaver starts "darkening" 10 seconds before the timeout - so for 1 minute it is within 50 seconds since last activity. So without shortening the default invocation time to 50 seconds this screensaver "poking" would come simply too late, when the screen would be totally dark.

Attachments (3)

screensaver-x11.cpp.diff (2.3 KB) - added by Petr Stehlik <pstehlik@…> 13 years ago.
gnome screensaver support patch (simpler)
screensaver-x11.cpp+h.diff (2.8 KB) - added by Petr Stehlik <pstehlik@…> 13 years ago.
gnome screensaver support patch (separate slots, just for sure?)
screensaver-x11.cpp.2.diff (2.0 KB) - added by Petr Stehlik <pstehlik@…> 12 years ago.
updated for current trunk

Download all attachments as: .zip

Change History (9)

Changed 13 years ago by Petr Stehlik <pstehlik@…>

Attachment: screensaver-x11.cpp.diff added

gnome screensaver support patch (simpler)

Changed 13 years ago by Petr Stehlik <pstehlik@…>

Attachment: screensaver-x11.cpp+h.diff added

gnome screensaver support patch (separate slots, just for sure?)

comment:1 Changed 13 years ago by coling

I posted this on the devel mailing list but no-body listened :'(

Here it is again. Basically, I don't think calling gnome-screensaver directly is the right solution where a universal solution is available instead. I believe this could replace the xscreensaver stuff (tho' can't confirm it).

The best solution here would be to use xdg-screensaver as that should
work for Gnome, KDE or any other DE that conforms to the goals for the
Portland project.

http://portland.freedesktop.org/wiki/

In my distro, (Mandriva) xdg-screensaver is provided by the xdg-utils
package.

Summary     : Interfaces and Tools to allow all applications to easily
integrate with the free desktop configuration

I'd imagine you want to run:

 xdg-screensaver suspend WindowID
and
 xdg-screensaver resume WindowID


       suspend WindowID
              Suspends the screensaver and monitor power management. WindowID
              must be the X Window ID of an existing window of the calling
              application. The window must remain in existance for the
              duration of the suspension.

              WindowID can be represented as either a decimal number or as a
              hexadecimal number consisting of the prefix 0x followed by one
              or more hexadecimal digits.

              The screensaver can be suspended in relation to multiple windows
              at the same time. In that case screensaver operation is only
              restored once the screensaver has been resumed in relation to
              each of the windows

       resume WindowID
              Resume the screensaver and monitor power management after being
              suspended.  WindowID must be the same X Window ID that was
              passed to a previous call of xdg-screensaver suspend

comment:2 Changed 12 years ago by DannyCan@…

Petr, Your patch will no longer patch with the latest mythtv svn trunk.
I am getting this output:

# patch mythtv/libs/libmyth/screensaver-x11.cpp screensaver-x11.cpp+h.diff
patching file mythtv/libs/libmyth/screensaver-x11.cpp
Hunk #1 FAILED at 21.
1 out of 1 hunk FAILED -- saving rejects to file mythtv/libs/libmyth/screensaver-x11.cpp.rej
can't find file to patch at input line 13
Perhaps you should have used the -p or --strip option?
The text leading up to this was:
--------------------------
|--- mythtv/libs/libmyth/screensaver-x11.cpp.orig       2006-12-09 00:38:46.000000000 +0100
|+++ mythtv/libs/libmyth/screensaver-x11.cpp    2007-06-20 23:44:42.000000000 +0200
--------------------------
File to patch:

This is the contents of the screensaver-x11.cpp.rej file:

***************
*** 21,26 ****

    public slots:
      void resetSlot();

    protected:
      class ScreenSaverX11Private *d;
--- 21,27 ----

    public slots:
      void resetSlot();
+     void resetSlotG();

    protected:
      class ScreenSaverX11Private *d;

Could you update the patch to work again please? And maybe a dev can put it into the trunk?
Thanks in advance!

comment:3 Changed 12 years ago by Anduin Withers

Owner: changed from Isaac Richards to Anduin Withers

comment:4 Changed 12 years ago by Petr Stehlik <pstehlik@…>

Updated patch attached.

Changed 12 years ago by Petr Stehlik <pstehlik@…>

Attachment: screensaver-x11.cpp.2.diff added

updated for current trunk

comment:5 Changed 12 years ago by Anduin Withers

Resolution: fixed
Status: newclosed

(In [14755]) Closes #3652

Adds Gnome screensaver support (same as our current xscreensaver support).

Thanks to Petr Stehlik for this patch.

comment:6 Changed 12 years ago by Anduin Withers

(In [15208]) References #3652

Set default xscreensaverInterval to 50 seconds, as was done in the original patch from Petr Stehlik.

Note: See TracTickets for help on using tickets.