Support for other screensavers

Bug #1266953 reported by Cavia Porcellus
90
This bug affects 16 people
Affects Status Importance Assigned to Milestone
Caffeine
Fix Released
High
Unassigned

Bug Description

Caffeine does not prevent XScreenSaver from running when watching a video using Totem (AKA Videos). It does detect when Totem runs ("INFO:root:Caffeine has detected that the process 'totem' is running, and will auto-activate"), but then the screensaver starts up anyhow. It correctly blocks XScreenSaver when VLC is used, however.

I'm using Caffeine version 2.5 (bzr 532), XScreenSaver 5.15, and Totem 3.8.2 on Ubuntu 13.10.

Thanks.

Revision history for this message
Paulius Vitkus (behda) wrote :

At the moment Caffeine only works on default Ubuntu.
Also should work on Ubuntu GNOME because it uses same dbus interface calls.

I have fixed caffeine to work for me on Xubuntu. So it works with xscreensaver.
My version sould also work with Kubuntu and Lubuntu. Though haven't tested on them much.

You can get and try my version at https://launchpad.net/~behda/+archive/ppa
If developers want to add my fixes i'll be happy.

Revision history for this message
Cavia Porcellus (caviaporcellus) wrote :

Paulius, I assume you mean it works only with gnome-screensaver, not XScreenSaver (since I use stock Ubuntu). Regardless, your version makes it so XScreenSaver does not start when Totem is playing.
Thank you! I hope your changes can be incorporated into the main version.

Revision history for this message
Paulius Vitkus (behda) wrote :

If I remember right then gnome-screensaver isn’t a real screensaver anymore. In a sense like a separate program to run screensaver.

On Ubuntu, Xubuntu, etc. you prevent screen/computer suspension with dbus calls. At present almost all derivatives use different dbus calls. Maybe it will change in the future.

Original Caffeine (version 2.4) stopped working around when 12.10 came out. It was because dbus calls have changed then.

XScreenSaver is a separate program that must be detected. My version does that.

Revision history for this message
Cavia Porcellus (caviaporcellus) wrote :

Hm, the original Caffeine worked for me using XScreenSaver up through 13.04. In any case, since gnome-screensaver does nothing and people who want a real screensaver essentially only have XScreenSaver to fall back upon, I hope the functionality Paulius added will be merged. It's been working great for me so far.

Revision history for this message
Reuben Thomas (rrt) wrote :

[I have retitled this bug and will mark other bugs as duplicates, as this issue is common and obviously needs a home.]

Caffeine previously contained code to work with lots of different screensavers. I removed this code in 2.5. Unfortunately, it seems that I was over-optimistic: I thought that most modern desktops implemented the freedesktop idle inhibition spec, but it turns out that they don't.

Paulius Vitkus kindly provided a patch to reintroduce a lot of this support:

https://code.launchpad.net/~behda/caffeine/trunk/+merge/201304

After some discussion, I concluded that the best way to implement this support was to do so in xdg-screensaver, and have Caffeine use just xdg-screensaver. This keeps complexity out of Caffeine, and puts it where other applications and desktops can benefit and contribute, in xdg-utils.

I would be very happy to accept a patch which makes Caffeine use xdg-screensaver (and only xdg-screensaver); and similarly, I'd be very happy to help get a patch for xdg-screensaver into xdg-utils. (In particular, xdg-screensaver does not currently support the freedesktop idle inhibition method, in any flavour). Conversely, I won't accept patches which add all this functionality back into Caffeine.

You can find the xdg-utils repository at: http://cgit.freedesktop.org/xdg/xdg-utils/ and its bug list at https://bugs.freedesktop.org/buglist.cgi?quicksearch=xdg-utils&list_id=388735

summary: - Caffeine does not stop XScreenSaver while using Totem
+ Support for other screensavers
Reuben Thomas (rrt)
Changed in caffeine:
status: New → Confirmed
importance: Undecided → High
Revision history for this message
Jeffery To (jefferyto) wrote :

For XScreenSaver on Ubuntu, I wrote something which may help: https://github.com/jefferyto/faux-gnome-screensaver

Revision history for this message
Reuben Thomas (rrt) wrote :

Ubuntu already has a patch to xdg-screensaver which uses DBus in GNOME, as of 1.1.0~rc1-2ubuntu6; I'll push this upstream when I finish my self-imposed Lenten coding fast.

Revision history for this message
Paviluf (je-rem-y-deactivatedaccount) wrote :

I tried caffeine in Netrunner (kubuntu fork) and it doesn't work.
I hope you can do something to make it works.

Revision history for this message
Rungholio (jegpqjlk) wrote :

I would be very happy to accept a patch which makes Caffeine use xdg-screensaver (and only xdg-screensaver); and similarly, I'd be very happy to help get a patch for xdg-screensaver into xdg-utils. (In particular, xdg-screensaver does not currently support the freedesktop idle inhibition method, in any flavour). Conversely, I won't accept patches which add all this functionality back into Caffeine.

My toaster only runs on 64 volt mains. Unfortunately most homes do not support 64 volt DC mains power, also it has this nasty habit of catching fire when things are left plugged in. I'd be very happy to have someone make a AC->DC step down converter. Conversely, I will be suing anyone attempting to modify the toaster to run on 120/240v systems.

Revision history for this message
Frank Bicknell (fbicknel) wrote :

@jegpqjlk: noice.

Revision history for this message
Reuben Thomas (rrt) wrote :

Fixed in Bazaar.

Revision history for this message
Reuben Thomas (rrt) wrote :

(Bug was fixed in r601; new release imminent.)

Revision history for this message
Reuben Thomas (rrt) wrote :

Unfortunately, the version of xdg-screensaver in Trusty (and even Vivid) does not work properly with GNOME 3. I will do my best to get this fixed for Vivid.

Revision history for this message
Reuben Thomas (rrt) wrote :

I have implemented a patch for xdg-screensaver and am now working to get it into the upcoming 1.1.0 release.

Reuben Thomas (rrt)
Changed in caffeine:
status: Confirmed → Fix Committed
Reuben Thomas (rrt)
Changed in caffeine:
status: Fix Committed → Fix Released
Revision history for this message
Waz (paviluf) wrote :

Thanks for the fix.
Will it work with KDE on Netrunner 14 (Kubuntu 14.04 derivative) ?

Revision history for this message
Waz (paviluf) wrote :

Ok I tried and it work with KDE.
Thank you very much !

Revision history for this message
Paulo Marcel Coelho Aragão (marcelpaulo) wrote :

It's working with Xfce (Xubuntu 14.10) too !

Revision history for this message
Peter Funk (pf-artcom-gmbh) wrote :

I'm running Kubuntu 14.04 LTS KDE desktop enviroment with Jamie Zawinskis xscreensaver as my screensaver.
I experienced the problem with xdg-screensaver (which is used by caffeine and other programs).
By overwriting the Ubuntu package xdg-utils Version: 1.1.0~rc1-2ubuntu7.1 with the latest version 1.1.1 obtained
from http://anongit.freedesktop.org/git/xdg/xdg-utils.git and the following commands::

      ./configure --prefix=/usr
     make
    sudo make install

I was able to fix the problem on my computer.

Revision history for this message
Reuben Thomas (rrt) wrote :

Updating xdg-utils shouldn't change anything: caffeine currently has its own patched version of xdg-screensaver.

Revision history for this message
Peter Funk (pf-artcom-gmbh) wrote :

I'm running Kubuntu 14.04 LTS KDE desktop enviroment with Jamie Zawinskis xscreensaver as my screensaver.
I experienced the problem with xdg-screensaver (which is used by caffeine and other programs).
By overwriting the Ubuntu package xdg-utils Version: 1.1.0~rc1-2ubuntu7.1 with the latest version 1.1.1 obtained
from http://anongit.freedesktop.org/git/xdg/xdg-utils.git and the following commands::

      ./configure --prefix=/usr
     make
    sudo make install

I was able to fix the problem on my computer.

Revision history for this message
Reuben Thomas (rrt) wrote :

I'm sorry, I thought you were running caffeine.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.