[Xfce4-commits] [apps/xfce4-screensaver] 256/425: properly lock even if already active
noreply at xfce.org
noreply at xfce.org
Mon Oct 15 01:51:43 CEST 2018
This is an automated email from the git hooks/post-receive script.
b l u e s a b r e p u s h e d a c o m m i t t o b r a n c h m a s t e r
in repository apps/xfce4-screensaver.
commit 156f1b626cdd4e22beea0fbdba5869e2f693020a
Author: Marc Deslauriers <marc.deslauriers at ubuntu.com>
Date: Tue Jan 31 20:28:26 2012 +0400
properly lock even if already active
If the screensaver is already active without a lock, and it got a
request to lock, it would bail out without switching to a locked
state.
https://bugzilla.gnome.org/show_bug.cgi?id=668967
---
src/gs-monitor.c | 17 +++++++++++------
1 file changed, 11 insertions(+), 6 deletions(-)
diff --git a/src/gs-monitor.c b/src/gs-monitor.c
index 56ef901..42dead3 100644
--- a/src/gs-monitor.c
+++ b/src/gs-monitor.c
@@ -174,18 +174,23 @@ static void gs_monitor_lock_screen(GSMonitor* monitor)
{
gboolean res;
gboolean locked;
+ gboolean active;
/* set lock flag before trying to activate screensaver
in case something tries to react to the ActiveChanged signal */
gs_manager_get_lock_active(monitor->priv->manager, &locked);
gs_manager_set_lock_active(monitor->priv->manager, TRUE);
- res = gs_listener_set_active(monitor->priv->listener, TRUE);
+ active = gs_manager_get_active(monitor->priv->manager);
- if (! res)
- {
- /* If we've failed then restore lock status */
- gs_manager_set_lock_active(monitor->priv->manager, locked);
- gs_debug("Unable to lock the screen");
+ if (!active) {
+ res = gs_listener_set_active(monitor->priv->listener, TRUE);
+
+ if (!res)
+ {
+ /* if we've failed then restore lock status */
+ gs_manager_set_lock_active(monitor->priv->manager, locked);
+ gs_debug("Unable to lock the screen");
+ }
}
}
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
More information about the Xfce4-commits
mailing list