[Portland] xdg-screensaver suspend/resume and status

Jarno Suni sunijarno at gmail.com
Fri Apr 2 08:30:05 UTC 2021


Hi,

In my MR I am mostly interested in "lock" command, because I think it
is good aid in locking function in Xfce4.

But as for suspend/resume commands of the script, I am not so familiar
with them. Do some DEs/applications use those?

I looked at the script, and it seems like not all screensavers do the
same thing. Especially, if there are many apps that have suspended a
screensaver, the first one resuming by resume command should not
actually resume. Man page tells:
"The screensaver can be suspended in relation to multiple windows at
the same time. In that case screensaver operation is only restored
once the screensaver has been resumed in relation to each of the
windows"
For example screensaver_xserver() seems to resume by the command, if
the screensaver has been suspended by xdg-screensaver no matter if
another app window is causing suspending, too. For others such as
xscreensaver the resume command does nothing but exits with 0.

Are there any guidelines for implementing suspend/resume functions?

Some screensaver such as xfce4-screensaver have inhibition command
(xfce4-screensaver-command -i) that suspends screensaver until the
command process  terminates. For those suspending can be implemented
without screensaver_suspend_loop(), I think.

And then there is status function. Man page says "Prints enabled to
stdout if the screensaver is enabled to turn on after a period of
inactivity and prints disabled if the screensaver is not enabled."
What kind of use cases this command has?xautolock_screensaver() seems
to unlock by that command. screensaver_xscreensaver() tells, if
screensaver has been suspended by xdg-screensaver. For
gnome-screensaver it tells if screen is currently locked (Can it even
blank without locking nowadays? And can it blank on idle? There is
some perl script in screensaver_gnome_screensaver but I don't know
perl.) For gnome-screensaver derivatives (such as cinnamon) it tells
if screensaver is currently activated or locking (I think). For
screensaver_xserver() it tells if screensaver is set up to activate
after some period, but it may not have an effect anyway. Is there some
mechanism you can bind an actual screensaver to that xserver property
and how to check, if such a binding has been made?


More information about the Portland mailing list