← Back to team overview

registry team mailing list archive

[Bug 310351] Re: Kubuntu screensaver xdg-screensaver broken

 

Launchpad has imported 7 comments from the remote bug at
http://bugs.freedesktop.org/show_bug.cgi?id=26085.

If you reply to an imported comment from within Launchpad, your comment
will be sent to the remote bug automatically. Read more about
Launchpad's inter-bugtracker facilities at
https://help.launchpad.net/InterBugTracking.

------------------------------------------------------------------------
On 2010-01-17T12:45:00+00:00 Jpeg-videolan wrote:

Hi,

Under KDE4, instead of calling the DBUS method UnInhibit, the script
xdg-screensaver calls the method SetActive. This starts the screensaver
immediately, and this is absolutely not the expected behaviour.

The function screensaver_freedesktop() in the script is broken (and
there are some FIXME's around). Here's a diff of what it should look
like:


diff --git a/usr/bin/xdg-screensaver b/xdg-screensaver
index 29e8e18..015cc2e 100755
--- a/usr/bin/xdg-screensaver
+++ b/xdg-screensaver
@@ -558,13 +558,13 @@ screensaver_freedesktop()
 {
     case "$1" in
         suspend)
-        #FIXME (get/store cookie)
-        qdbus org.freedesktop.ScreenSaver /ScreenSaver org.freedesktop.ScreenSaver.Inhibit $window_id xdg-screensaver  > /dev/null
+        qdbus org.freedesktop.ScreenSaver /ScreenSaver org.freedesktop.ScreenSaver.Inhibit $window_id xdg-screensaver >| "$screensaver_file.cookie" 2> /dev/null
         result=$?
         ;;
 
         resume)
-        qdbus org.freedesktop.ScreenSaver /ScreenSaver org.freedesktop.ScreenSaver.SetActive true > /dev/null
+        qdbus org.freedesktop.ScreenSaver /ScreenSaver org.freedesktop.ScreenSaver.UnInhibit `cat "$screensaver_file.cookie"` > /dev/null
+        rm -f "$screensaver_file.cookie"
         result=$?
         ;;
 
@@ -578,8 +578,8 @@ screensaver_freedesktop()
         ;;
 
         reset)
-        #FIXME (cookies?)
-        qdbus org.freedesktop.ScreenSaver /ScreenSaver org.freedesktop.ScreenSaver.UnInhibit $window_id > /dev/null
+        qdbus org.freedesktop.ScreenSaver /ScreenSaver org.freedesktop.ScreenSaver.UnInhibit `cat "$screensaver_file.cookie"` > /dev/null
+        rm -f "$screensaver_file.cookie"
         result=$?
         ;;

Best regards,

Reply at: https://bugs.launchpad.net/xdg-utils/+bug/310351/comments/2

------------------------------------------------------------------------
On 2010-01-18T05:29:38+00:00 Rdieter-math wrote:

Thanks!

fabo, I'm going ahead and committing this (holler at me if you had
something else in mind).

Now, if some kind soul could translate the (easier) qdbus calls to dbus-
send ... :)

Reply at: https://bugs.launchpad.net/xdg-utils/+bug/310351/comments/3

------------------------------------------------------------------------
On 2010-01-18T05:38:50+00:00 Rdieter-math wrote:

committed.

Reply at: https://bugs.launchpad.net/xdg-utils/+bug/310351/comments/4

------------------------------------------------------------------------
On 2010-01-18T06:59:52+00:00 Jpeg-videolan wrote:

Hi, thanks a lot for being so quick!
I hope this will fix the issues I had, I'll keep you in touch if there are still problems.

Best regards,

Reply at: https://bugs.launchpad.net/xdg-utils/+bug/310351/comments/5

------------------------------------------------------------------------
On 2010-01-21T05:20:36+00:00 Jpeg-videolan wrote:

Hello guys,

I think there is still a problem with the inhibition mechanism on KDE4 (and maybe any DE that uses the DBus interface). The call to the Inhibit method can't work because the calling process (qdbus or dbus-send) exits immediately.
Here's what the specification states:


        Name:           Inhibit
        Args:           DBUS_TYPE_STRING "application-name"
                        DBUS_TYPE_STRING "reason for inhibit"
        Returns:        INT cookie
                        This is a random number used to identify the
                        request.
        Description:    Request that saving the screen due to system
                        idleness be blocked until UnInhibit is called or the
                        calling process exits.

Found at:
http://lists.freedesktop.org/archives/xdg/2007-March/009187.html
(no idea at what point this reflects the actual implementation)

This kind of sucks, and the screensaver indeed activates itself as if no call to Inhibit were passed. (no matter what value I use as "application-name")
Using qdbusviewer and a small Qt program (processes that do not exit), I have been able to prevent the screensaver activation.

Sorry, I have no patch this time, I don't see any way to pass a call
from a Shell script without exiting :-(

Best regards and thanks again.

Reply at: https://bugs.launchpad.net/xdg-utils/+bug/310351/comments/6

------------------------------------------------------------------------
On 2010-02-21T10:14:28+00:00 Rdieter-math wrote:

True, seems to me this interfaces was written not with xdg-utils in
mind, and that apps should use the dbus method directly themselves.

Reply at: https://bugs.launchpad.net/xdg-utils/+bug/310351/comments/7

------------------------------------------------------------------------
On 2010-08-28T19:10:35+00:00 Mtdean wrote:

Created an attachment (id=38251)
Use SimulateUserActivity. instead of Inhibit for D-Bus screensavers

The screensaver_freedesktop Inhibit call only prevents the screensaver
from activating during the lifetime of the calling process.
Unfortunately, since xdg-screensaver uses dbus-send to send the request,
it expires as soon as the dbus-send process terminates.

Therefore, this patch changes the screensaver_freedesktop to use
SimulateUserActivity in a screensaver_suspend_loop.

The ideal solution would be to change the specification for the D-Bus
interface to either allow an option "OnBehalfOf" argument for the
Inhibit method call or to add a new method allowing an application to
send a request for another application.  The D-Bus interface for the
screensavers seems to have been created by freedesktop.org, so perhaps
the Portland group can apply some pressure to the D-Bus interface
designers so that we can finally have one application that allows
interfacing with all screensavers--even those that don't, and won't
ever, support D-Bus (like xscreensaver).

Reply at: https://bugs.launchpad.net/xdg-utils/+bug/310351/comments/9


** Changed in: xdg-utils
   Importance: Unknown => Medium

-- 
Kubuntu screensaver xdg-screensaver broken
https://bugs.launchpad.net/bugs/310351
You received this bug notification because you are a member of Registry
Administrators, which is the registrant for Debian.