! Please note that this is a snapshot of our old Bugzilla server, which is read only since May 29, 2020. Please go to gitlab.xfce.org for our new server !
Xflock4 should not just assume xlock is installed
Status:
RESOLVED: FIXED
Priority:
Very Low
Product:
Xfce-utils
Component:
General

Comments

Description Dieter Plaetinck 2008-10-05 11:25:49 CEST
xlock is not installed by default on some distro's. (even if xorg is installed)
Yet, xflock4 tries to use it if it could not use xscreensaver or gnome-screensaver, breaking the script.
Imho, xflock4 should also try to see if xlock is installed before trying to use it.  If xflock4 can find neither xscreensaver, gnome-screensaver or xlock, it should echo an error message on stderr. (and maybe a gtk error popup) stating it cannot work.

Another approach would be stating xlock as a dependency of xflock4, but that would be dirty if the user has xscreensaver or gnome-screensaver.  (In fact, xflock4 depends on either one of the 3 options, it's up to the user to decide.  But I've never seen a package manager supporting a structure like that)

See http://bugs.archlinux.org/task/11609
Comment 1 Yves-Alexis Perez editbugs 2008-10-05 11:30:56 CEST
xflock4 should check the *running* screensaver (xscreensaver, gnome-screensaver and maybe kde equivalent, for crazy users). And fallback to xlockmore (which has nothing to do with xorg, btw).

Packagers can then add the dependency they need (like xlockmore | xscreensaver | gnome-screensaver). But anyway dependency is not really the dev's problem.

Cheers,
--
Yves-Alexis
Comment 2 Dieter Plaetinck 2008-10-05 12:30:15 CEST
> And fallback to xlockmore (which has nothing to do with xorg, btw).

If it's available!  (That was my whole point, not everyone has it)  Xflock4 should be prepared for when no screensaver/lock tool is available and show an error appropriately.
Comment 3 Brian J. Tarricone (not reading bugmail) 2008-10-05 12:34:51 CEST
Patches welcome...
Comment 4 Dieter Plaetinck 2008-10-05 12:51:57 CEST
Created attachment 1868 
patch for xflock4.  generated with diff -Naur

Here you go.  It will display an error on stderr and with zenity (gtk error message) if available.

I also took the liberty of improving the other shell code a bit.
Comment 5 Dieter Plaetinck 2008-10-05 12:56:18 CEST
Created attachment 1869 
new patch with better exit status this time.

Same as before, but now set proper exit status.
generated with diff -Naur.
Comment 6 Brian J. Tarricone (not reading bugmail) 2008-10-05 13:11:55 CEST
Suggest a fallback to 'xmessage' if zenity isn't installed.
Comment 7 Dieter Plaetinck 2008-10-05 14:01:35 CEST
Let's not exaggerate.  Xmessage is very ugly.  The user can always execute it on commandline and look at stderr. 
If there is a better way to show a gtk error in Xfce (without zenity) that would be better though, but that would probably mean a rewrite of xflock4 in C.  Don't think that's worth it.
Comment 8 Yves-Alexis Perez editbugs 2008-10-05 15:13:03 CEST
(In reply to comment #2)
> > And fallback to xlockmore (which has nothing to do with xorg, btw).
> 
> If it's available!  (That was my whole point, not everyone has it)  Xflock4
> should be prepared for when no screensaver/lock tool is available and show an
> error appropriately.

I'd say, if $user don't have any locking stuff, we don't give a shit. It'll fail, but eh, that's normal.

(In reply to comment #7)
> Let's not exaggerate.  Xmessage is very ugly.  The user can always execute it
> on commandline and look at stderr. 
> If there is a better way to show a gtk error in Xfce (without zenity) that
> would be better though, but that would probably mean a rewrite of xflock4 in C.
>  Don't think that's worth it.

If warning $user, you should take care of really warning him. Either you do it completely or you don't to it at all.

My 2 cents.
Comment 9 Dieter Plaetinck 2008-10-05 15:22:12 CEST
(In reply to comment #8)
> (In reply to comment #2)
> > > And fallback to xlockmore (which has nothing to do with xorg, btw).
> > 
> > If it's available!  (That was my whole point, not everyone has it)  Xflock4
> > should be prepared for when no screensaver/lock tool is available and show an
> > error appropriately.
> 
> I'd say, if $user don't have any locking stuff, we don't give a shit. It'll
> fail, but eh, that's normal.

I hope you're joking.  xflock4 comes with Xfce, so users expect it to work and not to break.  They expect to have locking functionality or at least to be given instructions on how to get what they want.
Comment 10 Yves-Alexis Perez editbugs 2008-10-05 15:53:09 CEST
(In reply to comment #9)
> I hope you're joking.  

No I'm not. And I'm not interested in trolls on bug reports either.

> xflock4 comes with Xfce, so users expect it to work and
> not to break. 

Sure

> They expect to have locking functionality or at least to be
> given instructions on how to get what they want.

Well, Xfce doesn't provide any locking capability by itself, they rely on something else. If the user uses a distribition, it's the packager role to provide the correct locking stuff. If using tarballs, installer or svn, I guess $user is able to find the required info by himself.

I'm not against warning the user, I just don't think it's a good idea in that case. Document that xflock4 needs (obviously) a locking utility, document what it needs (*screensaver, xlockmore). But don't bother him.
Comment 11 Nick Schermer editbugs 2012-04-18 20:00:25 CEST
Should be fixed in master.

Bug #4448

Reported by:
Dieter Plaetinck
Reported on: 2008-10-05
Last modified on: 2012-04-18

People

Assignee:
Xfce Bug Triage
CC List:
2 users

Version

Attachments

Additional information