Bug 1266521 - xscreensaver autostarts itself unless gnome-screensaver is installed
xscreensaver autostarts itself unless gnome-screensaver is installed
Status: CLOSED RAWHIDE
Product: Fedora
Classification: Fedora
Component: xscreensaver (Show other bugs)
rawhide
Unspecified Unspecified
unspecified Severity unspecified
: ---
: ---
Assigned To: Mamoru TASAKA
Fedora Extras Quality Assurance
: FutureFeature, Regression
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2015-09-25 09:40 EDT by Nils Philippsen
Modified: 2017-07-20 06:15 EDT (History)
5 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2017-07-20 06:15:14 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Nils Philippsen 2015-09-25 09:40:57 EDT
Description of problem:
Since the upgrade to Fedora 23 Beta, xscreensaver locks the desktop after a while even though GNOME Shell is running. I think this is similar to bug #517391, maybe even a regression.

The gnome-screensaver package hasn't been installed by default for a long time, so relying on /usr/bin/gnome-screensaver presence to not start xscreensaver won't work anymore.

The change mentioned in bug #517391, i.e. adding "OnlyShowIn=GNOME" seems to be have the opposite effect of what it should achieve, it means that xscreensaver must be started in GNOME[1]. This should probably be "NotShowIn=KDE,GNOME".

[1]: "The OnlyShownIn entry may contain a list of strings identifying the desktop environments that MUST autostart this application, all other desktop environments MUST NOT autostart this application." -- http://standards.freedesktop.org/autostart-spec/autostart-spec-latest.html

Version-Release number of selected component (if applicable):
xscreensaver-5.33-3.respin1.fc23.x86_64

How reproducible:
Reproducible

Steps to Reproduce:
1. On a F-23 Workstation, have xscreensaver installed (but not gnome-screensaver)
2. Log into GNOME
3. Set blank time to 1 minute (`xscreensaver-command -prefs`)
4. Wait

Actual results:
XScreensaver locks the desktop after a minute, after unlocking there's a notification that GNOME couldn't look the screen (if you've waited long enough -- 3 minutes? -- for GNOME to attempt to do it).

Expected results:
XScreensaver doesn't start in a desktop environment that has its own screen-locking mechanism, like GNOME.
Comment 1 Mamoru TASAKA 2015-09-28 00:33:53 EDT
Well, as you have set "blank time to 1 minute", xscreensaver MUST blank your screen after 1 minute. As you've installed xscreensaver, I expect that you want to use xscreensaver to lock screen.

And, still if you don't want xscreensaver to lock screen, you should be able to set it using GNOME autostart setting, I guess.
Comment 2 Nils Philippsen 2015-10-04 12:57:39 EDT
Heh, I expressed myself badly. It was set to blank by default (I just checked that by removing ~/.xscreensaver, then starting `xscreensaver-command -prefs` to write out the default configuration). I just reduced the time for testing, so the issue doesn't take so long to exhibit itself.

I think that by default, xscreensaver shouldn't autostart in desktop environments like GNOME, KDE (who have their own screensaver system) to cater for e.g. multi-user systems where each user can have a different DE.
Comment 3 Nils Philippsen 2015-10-04 13:17:15 EDT
(In reply to Mamoru TASAKA from comment #1)
> And, still if you don't want xscreensaver to lock screen, you should be able
> to set it using GNOME autostart setting, I guess.

...and this doesn't work either. While you can configure additional startup applications using gnome-tweak-tool (if you have it installed), xscreensaver doesn't show up there.
Comment 4 Kevin Fenzi 2016-01-22 19:48:40 EST
Please drop this autostart file or change it to not start in gnome.

> As you've installed xscreensaver, I expect that you want to use xscreensaver to lock screen.

I have both Xfce and gnome installed here and switch between them. I want xscreensaver only when running Xfce. It shouldn't be used when I am logged into gnome.
Comment 5 Mamoru TASAKA 2016-01-23 01:55:18 EST
Patch welcome, and please make it sure that that patch won't change behavior on other DM.
Comment 6 Mamoru TASAKA 2016-01-23 02:00:18 EST
Note that on GNOME2 gnome2 itself always overwrote xscreensaver desktop behavior so that xscreensaver won't be autostarted. So I wonder why GNOME3 can't do that.
Comment 7 Kevin Fenzi 2016-01-23 13:59:13 EST
(In reply to Mamoru TASAKA from comment #5)
> Patch welcome, and please make it sure that that patch won't change behavior
> on other DM.

Well, the patch would be to simply stop shipping the /etc/xdg/autostart/xscreensaver-autostart.desktop file entirely. 

diff --git a/xscreensaver.spec b/xscreensaver.spec
index f3c7bd0..d8aeafd 100644
--- a/xscreensaver.spec
+++ b/xscreensaver.spec
@@ -10,7 +10,7 @@
 %define split_getimage   1
 %endif
 
-%define fedora_rel    1
+%define fedora_rel    2
 
 %global use_clang_as_cc 0
 %global use_clang_analyze 0
@@ -48,7 +48,6 @@ Source10:        update-xscreensaver-hacks
 %endif
 %if 0%{?fedora} >= 12
 Source11:        xscreensaver-autostart
-Source12:        xscreensaver-autostart.desktop
 %endif
 ##
 ## Patches
@@ -808,20 +807,9 @@ cp -a $archdir/clang-analyze/*/* clang-analyze/html
 popd
 %endif
 
-# Install desktop application autostart stuff
-# Add OnlyShowIn=GNOME (bug 517391)
 %if 0%{?fedora} >= 12
-mkdir -p ${RPM_BUILD_ROOT}%{_sysconfdir}/xdg/autostart
 install -cpm 0755 %{SOURCE11} ${RPM_BUILD_ROOT}%{_libexecdir}/
-desktop-file-install \
-   --vendor "" \
-   --dir ${RPM_BUILD_ROOT}%{_sysconfdir}/xdg/autostart \
-   --add-only-show-in=GNOME \
-   %{SOURCE12}
-chmod 0644 ${RPM_BUILD_ROOT}%{_sysconfdir}/xdg/autostart/xscreensaver*.desktop
-
 echo "%{_libexecdir}/xscreensaver-autostart" >> $dd/base.files
-echo '%{_sysconfdir}/xdg/autostart/xscreensaver*.desktop' >> $dd/base.files
 %endif
 
 # Create desktop entry for gnome-screensaver
@@ -985,6 +973,9 @@ exit 0
 %endif
 
 %changelog
+* Sat Jan 23 2016 Kevin Fenzi <kevin@scrye.com> - 1:5.34-2
+- Remove /etc/xdg/autostart/xscreensaver-autostart.desktop file. Bug #1266521
+
 * Sun Oct 25 2015 Mamoru TASAKA <mtasaka@fedoraproject.org> - 1:5.34-1
 - Update to 5.34
Comment 8 Mamoru TASAKA 2016-02-03 05:34:12 EST
(In reply to Kevin Fenzi from comment #7)
> (In reply to Mamoru TASAKA from comment #5)
> > Patch welcome, and please make it sure that that patch won't change behavior
> > on other DM.
> 
> Well, the patch would be to simply stop shipping the
> /etc/xdg/autostart/xscreensaver-autostart.desktop file entirely. 
> 

This is not acceptable, because even if a DM (other than GNOME) does not autostart xscreensaver-autostart, still such DM can see xscreensaver-autostart _entry_ and some settings application for autostart menu (such as lxsession-default-apps in LXDE, for example) can show such entry so that user can enable or disable xscreensaver-autostart.
Comment 9 Mamoru TASAKA 2016-02-03 05:39:04 EST
(Oops, not DM but DE)

So an acceptable solution is that even if xscreensaver-autostart.desktop does not autostart itself on any DE, still xscreensaver-autostart.desktop can be seen on such DE and user can enable or disable xscreensaver-autostart using DE specific application.
Comment 10 Mamoru TASAKA 2016-02-03 08:05:59 EST
Maybe using some fake DE entry such as --add-only-show-in=X-NOTBYDEFAULT is possible solution? (as far as I read $ man desktop-file-install)
Comment 11 Mamoru TASAKA 2016-02-03 08:17:24 EST
Anyway changing Version to rawhide, as I am very conservative for changing this type of configuation on stable branch.
Comment 12 Kevin Fenzi 2016-02-03 18:32:02 EST
I don't know much about LXDE, but Xfce actually ships with a xscreensaver desktop file with OnlyShowIn=XFCE; (in xfce4-session):

http://git.xfce.org/xfce/xfce4-session/tree/scripts/xscreensaver.desktop.in
which we install to: 
/etc/xdg/autostart/xscreensaver.desktop

How about instead of removing it from xscreensaver you add: 
NotShowIn=GNOME;KDE;XFCE

then other DE's can use it, but it won't interfere with gnome (which has it's own locker) or kde (which I think also does) and Xfce (which uses it's own autostart desktop file).
Comment 13 Jan Kurik 2016-02-24 08:47:38 EST
This bug appears to have been reported against 'rawhide' during the Fedora 24 development cycle.
Changing version to '24'.

More information and reason for this action is here:
https://fedoraproject.org/wiki/Fedora_Program_Management/HouseKeeping/Fedora24#Rawhide_Rebase
Comment 14 Rex Dieter 2017-07-10 13:04:19 EDT
Since this is old, rebasing to rawhide/FutureFeature, to avoid autoclosure.

That said, I echo what Kevin suggests in comment #12, to use either NotShowIn=... (to blacklist DE's that don't want/need it) or OnlyShowIn=... to whitelist DE's that *do* want it.
Comment 15 Mamoru TASAKA 2017-07-20 06:15:14 EDT
Since I want to keep this file installed (at least LXDE can make use of this even if LXDE is not in OnlyShowIn), for now, for F-27 I changed OnlyShowIn to X-NONDEFAULT.
Once closing.

Note You need to log in before you can comment on or make changes to this bug.