Ubuntu

gnome-screensaver forces itself upon xscreensaver users

Reported by Dan Muresan on 2011-02-28
26
This bug affects 4 people
Affects Status Importance Assigned to Milestone
gnome-screensaver (Ubuntu)
Low
Unassigned

Bug Description

Binary package hint: gnome-screensaver

gnome-screensaver installs the DBus file

/usr/share/dbus-1/services/org.gnome.ScreenSaver.service

which unconditionally starts gnome-screensaver whenever some other process (e.g. nm-applet, update-notifier) "pull the trigger". This is troubling for users of non-gnome desktop environments, e.g. LXDE.

A workaround for me was to install the following /usr/local/share/dbus-1/services/org.gnome.ScreenSaver.service:

[D-BUS Service]
Name=org.gnome.ScreenSaver
Exec=/bin/sh -c 'if xscreensaver-command -version >/dev/null 2>&1; then renice +10 $$ >/dev/null 2>&1; while sleep 60; do :; done else exec /usr/bin/gnome-screensaver; fi' gnome-screensaver-placeholder

The dummy process remains active because if it exited immediately, dbus might try to restart gnome-screensaver. I don't know if this is really necessary.

First of all, this needs to be fixed -- screensavers should not step on each others' toes. Secondly, is there a more elegant workaround? Note that because of bug #726471, a user can't override a misguided /usr/share/ service file in his home (~/.local/share) configuration:

https://bugs.launchpad.net/ubuntu/+source/dbus/+bug/726471

ProblemType: Bug
DistroRelease: Ubuntu 10.04
Package: gnome-screensaver 2.30.0-0ubuntu2
ProcVersionSignature: Ubuntu 2.6.31-11.154-rt
Uname: Linux 2.6.31-11-rt i686
Architecture: i386
Date: Mon Feb 28 12:44:49 2011
GnomeSessionIdleInhibited: Unknown
GnomeSessionInhibitors: Failed to acquire
InstallationMedia: Xubuntu 10.04 "Lucid Lynx" - Release i386 (20100429)
ProcEnviron:
 LC_COLLATE=C
 PATH=(custom, user)
 LANG=en_US.utf8
 SHELL=/bin/bash
SourcePackage: gnome-screensaver
WindowManager: gnome-wm

Dan Muresan (danmbox) wrote :
Dan Muresan (danmbox) wrote :

My remark about processes that "pull the trigger" was based on an empirical observation: if I start LXDE with a disabled /etc/xdg/autostart/update-notifier.desktop, xscreensaver runs, and there is no gnome screensaver. Whenever one of nm-applet or update-notifier starts, dbus loads gnome-screensaver.

What these two applets seem to have in common is that they both pop up small banner-like notices. I can't find any actual code in update-notifier that "tickles" the screensaver.

Marc Deslauriers (mdeslaur) wrote :

If your desktop environment uses xscreensaver, you should simply not have the gnome-screensaver package installed. If the gnome-screensaver package isn't installed, the dbus service file isn't there.

affects: gnome-screensaver (Ubuntu) → lxde-common (Ubuntu)
Marc Deslauriers (mdeslaur) wrote :

I am reassigning this to lxde in case something in there is pulling gnome-screensaver in.

Dan Muresan (danmbox) wrote :

Apparently many developers have forgotten than Linux is a multi-user system.

Some users log into LXDE, some into gnome. Both need to work.

I've spent many hours debugging this problem and even made the effort to provide a workaround. The developers need to do their part.

LXDE is powerless to prevent nm-applet and update-notifier from triggering gnome-screensaver. Please do not reassign. And please read the report.

Julien Lavergne (gilir) wrote :

The problem is more complex.
You can't override gnome-screensaver DBus behavior, because applications should expect that gnome-screensaver is called with the Dbus method. But, some applications just assume that gnome-screensaver is the only screensaver in the world, which is wrong on a LXDE environnement. The correct fix is not to overrides this behavior, but to fix all applications calling blindly gnome-screensaver. The solution could be :
- to check first if a screensaver is running, and call it. Fallback to gnome-screensaver when nothing is running.
- Implement a "freedesktop" way to call screensaver, which fallback to the good screensaver. You can look at xdg-screensaver in xdg-utils package.

I'm setting the bug as Invalid for lxde-common, because it doesn't bring gnome-screensaver. But you can add packages you think they don't have a good behavior (like update-notifier or network-manager-gnome).

Changed in lxde-common (Ubuntu):
status: New → Invalid
Dan Muresan (danmbox) wrote :

Regardless of whether gnome-screensaver is started directly, or via the dbus service -- if it finds that xscreensaver is already present, do you think it should go right ahead, or quit? I think gnome-screensaver should notice that a screensaver is already active in X and abort.

The picture you describe is not what I was talking about. Neither update-notifier nor (I believe) network-manager-gnome call gnome-screensaver directly. They don't even call the dbus org.gnome.ScreenSaver method directly. Yet somehow, indirectly, they cause dbus to start the screensaver. As I said, the common theme seems to be those small banner-like notifications ("There are 3 updates available" or "Network disconnected"). Maybe there's some common code that pops up those notices and "checks" to see if the screensaver is active -- I don't know.

So the behavior you describe (applications calling gnome-screensaver directly) has nothing to do with what I reported. I agree that this is not an LXDE bug. This is a design bug for gnome-screensaver and its dbus hook.

Dan Muresan (danmbox) wrote :

The original question has not been addressed: should either gnome-screensaver itself, or the dbus org.gnome.ScreenSaver "Exec=" command, check for a running xscreensaver and abort?

Thus, this bug should stay in gnome-screensaver. If you really want to sweep it under the carpet, mark it as WONTFIX. If you want to fix it, I have included a simple workaround in the original submission (may I ask why it is not acceptable?)

Why update-notifier and nm-applet trigger org.gnome.ScreenSaver is a separate issue, and if time permits I will open a separate bug.

Changed in lxde-common (Ubuntu):
status: Invalid → New
Dan Muresan (danmbox) wrote :

As per my above comment, the original issue was not addressed

affects: lxde-common (Ubuntu) → gnome-screensaver (Ubuntu)
Marc Deslauriers (mdeslaur) wrote :

This needs to be fixed upstream. Could you please file a bug against gnome-screensaver et bugzilla.gnome.org and link the bug here. Thanks.

Changed in gnome-screensaver (Ubuntu):
status: New → Confirmed
importance: Undecided → Low
Tormod Volden (tormodvolden) wrote :

Good luck getting the gnome-screensaver guys to acknowledge that some people want to use a non-gnome screensaver :)

Please explain again why this is a bug in gnome-screensaver? If you call org.gnome.ScreenSaver, expect gnome-screensaver to act on it. The solution would be something like Julien suggests, a neutral xdg-screensaver wrapper, i.e. make any applications call something like org.freedesktop.ScreenSaver instead.

And yes, of course it must be possible to have gnome packages installed without having them take over any session.

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

Duplicates of this bug

Other bug subscribers