Control: tag -1 +help

Thanks for you report.

On Sat, 2018-11-24 at 18:26 +0200, Teemu Ikonen wrote:
> I think the correct behaviour in the case of cycle time = 0 would be
> to run the notification and locker commands one after the other.

I suppose when cycle time = 0 the XCB_SCREENSAVER_STATE_CYCLE case in
screensaver_event_cb() is never called (only XCB_SCREENSAVER_STATE_ON
is)? Are you able to debug that to confirm which events you are
actually seeing?

The docs say:

   -n cmd, --notifier=cmd
                   Run *cmd* when the screen saver activates because of user
                   inactivity. Shell-style quoting is supported. The notifier is
                   killed when X signals user activity or when the locker is
                   started. The locker is started after the first screen saver
                   cycle, as set with ``xset s TIMEOUT CYCLE``.

                   This can be used to run a countdown or (on laptops) dim the
                   screen before locking. For an example, see the script
                   *@CMAKE_INSTALL_PREFIX@/share/doc/xss-lock/dim-screen.sh*.

So I believe the correct fix would be to skip the notifier if the cycle
time is zero since "The locker is started after the first screen saver
cycle". In that case a cycle time of 0 would imply to me that the
locker should be started immediately, skipping the notifier. That would
also seem to be implied by the lack of a XCB_SCREENSAVER_STATE_CYCLE
event in this case.

Looking at [0] and all the related interfaces though I don't see how to
spot the case when cycle time is 0 (neither statically nor it changing
dynamically).

Unfortunately upstream seems to have been moribund and I'm not find any
active forks (nor any inactive ones with a relevant looking fix). If
you can come up with a plausible & tested patch I'd be happy to take a
look with a view to applying but I do not have the time to become
upstream for this software.

In the meantime I'm afraid I would take the view that using the -n with
cycle time = 0 (either explicitly or implicitly via something like
xfce4-power-manager messing with it) is not supported, so if you want
to use xfce4-power-manager then you should not use the -n option,
sorry. I suppose I could clarify the documentation on this point.

Ian.

[0] 
https://xcb.freedesktop.org/manual/structxcb__screensaver__notify__event__t.html
 

Reply via email to