Xfce Forum

Sub domains
 

You are not logged in.

#1 2021-05-17 06:49:44

jarnos
Member
From: Finland
Registered: 2009-03-22
Posts: 50
Website

Implementation of "Lock screen before sleep" feature

Can you describe how it currently works? Does it require systemd to be able to work? Is the mechanism same regardless of the use case: when sleep is requested by user manually via menu or when sleep is triggered e.g. by suspend button or when sleep is triggered due to inactivity of user?

Offline

#2 2021-05-17 12:02:09

ToZ
Administrator
From: Canada
Registered: 2011-06-02
Posts: 10,950

Re: Implementation of "Lock screen before sleep" feature

From https://git.xfce.org/xfce/xfce4-session … emd.c#n113 there is this function that handles that option:

static gboolean
xfsm_systemd_lock_screen (XfsmSystemd  *systemd,
                          GError **error)
{
  XfconfChannel *channel;
  gboolean       ret = TRUE;

  channel = xfsm_open_config ();
  if (xfconf_channel_get_bool (channel, "/shutdown/LockScreen", FALSE))
      ret = xfce_screensaver_lock (systemd->screensaver);

  return ret;
}

So, if the checkbox is enabled, it calls the xfce_screensaver_lock function, which is located here. The comments explain what the intent of the feature is:

/**
* xfce_screensaver_lock:
* @saver: The XfceScreenSaver object
*
* Attempts to lock the screen, either with one of the screensaver
* dbus proxies, the xfconf lock command, or one of the
* fallback scripts such as xdg-screensaver.
*
* RETURNS TRUE if the lock attempt returns success.
**/

I'm not sure, though, how this interacts or co-exists with the Lock Screen option in xfce4-power-manager. I generally leave the one in Session and Startup unchecked and the one in power manager checked.


Please remember to mark your thread [SOLVED] to make it easier for others to find
--- How To Ask For Help | FAQ | Developer Wiki  |  Community | Contribute ---

Offline

#3 2021-05-17 20:21:19

jarnos
Member
From: Finland
Registered: 2009-03-22
Posts: 50
Website

Re: Implementation of "Lock screen before sleep" feature

ToZ wrote:

I'm not sure, though, how this interacts or co-exists with the Lock Screen option in xfce4-power-manager. I generally leave the one in Session and Startup unchecked and the one in power manager checked.

Interesting. That is the way I like it, too, but you have to be careful to be able to do such a setting. I did some investigation: Please see this issue; maybe you have a word to say there, too.

Offline

Board footer

Powered by FluxBB