locking issues when lid is closed
Submitted by jorge
Description
Hello:
Using Xfce in Gentoo. In power manager settings I have enabled to lock the screen when the lid closes (with ac and battery). 10 seconds or so after unlocking the screen (by reopening the lid) an error message is displayed: "None of the screen locks ran successfully, the screen will not be locked.", even if the screen lock worked correctly. If I issue a screen lock by clicking the lock screen in the "Actions Button", or even by running the script xflock4 as an user, there is no error after unlocking the screen.
I am using xfce4-screensaver as the screensaver. Do not have any other screensaver or standalone locker (alock,slock, xlockmore) installed. Also, I'm using systemd. The xfce4-session property "LockCommand" is blank (null string) and systemd is not allowed to handle this request (property login-handle-lid-switch is set to FALSE in xfce4-power-manager), that is, I have all properties to their base value as shipped from Gentoo.
From what I've investigated, the error comes from the source file xfpm-manager.c
. The proposed offending lines are (453-458):
if (!xfce_screensaver_lock (manager->priv->screensaver))
{
xfce_dialog_show_error (NULL, NULL,
_("None of the screen lock tools ran "
"successfully, the screen will not "
"be locked."));
}
as you can see, this is executed only if the xfce_screensaver_lock
method returns FALSE. This method is found on the source file xfce-screensaver.c
(also of the power manager app). The important lines (501-525) are:
switch (saver->priv->screensaver_type) {
case SCREENSAVER_TYPE_FREEDESKTOP:
case SCREENSAVER_TYPE_MATE:
case SCREENSAVER_TYPE_GNOME:
case SCREENSAVER_TYPE_XFCE:
{
GVariant *response = NULL;
response = g_dbus_proxy_call_sync (saver->priv->proxy,
"Lock",
g_variant_new ("()"),
G_DBUS_CALL_FLAGS_NONE,
-1,
NULL,
NULL);
if (response != NULL)
{
g_variant_unref (response);
return TRUE;
}
else
{
return FALSE;
}
break;
}
As I'm using the default xfce4-screensaver, the case statement must have landed there. If this method (xfce_screensaver_lock) is returning FALSE, it means that the response was NULL and in turn that the call g_dbus_proxy_call_sync
somehow always return NULL in my system. I don't see the variable saver->priv->proxy
being declared in this method, so maybe the problem lies around there.
Version: 1.6.6