Bug 1303256 - gnome-shell doesn't lock the screen when using systemctl suspend
Summary: gnome-shell doesn't lock the screen when using systemctl suspend
Keywords:
Status: CLOSED EOL
Alias: None
Product: Fedora
Classification: Fedora
Component: gnome-shell
Version: 23
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Owen Taylor
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-01-29 23:25 UTC by Samuel Sieb
Modified: 2016-12-20 18:18 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2016-12-20 18:18:13 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Samuel Sieb 2016-01-29 23:25:49 UTC
I can't tell whether the issue is with systemd or Gnome, so I'll start here.
When suspend is triggered using the keyboard, the screen is locked and the laptop suspends.  When using "systemctl suspend", the laptop is suspended, but the session is not locked.

From systemd-inhibit --list I get (in part):

     Who: samuel (UID 1000/samuel, PID 11983/gnome-settings-)
    What: sleep
     Why: GNOME needs to lock the screen
    Mode: delay

     Who: GNOME Shell (UID 1000/samuel, PID 12013/gnome-shell)
    What: sleep
     Why: GNOME needs to lock the screen
    Mode: delay

     Who: samuel (UID 1000/samuel, PID 11983/gnome-settings-)
    What: handle-power-key:handle-suspend-key:handle-hibernate-key
     Why: GNOME handling keypresses
    Mode: block

It appears that the reason it works when using the suspend key is because Gnome takes that over, so systemd doesn't start the suspend until Gnome tells it to.  However, systemd is also supposed to give Gnome some time to do its locking before it does the suspend according to the stated purpose of the inhibitors.
Is it possible that Gnome ignores the notification from systemd because it expects to have handled the key before that.

Comment 1 Florian Müllner 2016-02-04 15:19:32 UTC
(In reply to Samuel Sieb from comment #0)
> Is it possible that Gnome ignores the notification from systemd because it
> expects to have handled the key before that.

No, we are supposed to handle logind's PrepareForSleep signal:
https://git.gnome.org/browse/gnome-shell/tree/js/ui/screenShield.js#n697

In fact, that's how the screen is locked when suspending via keyboard as well, as gnome-settings-daemon simply handles the key by calling logind's Suspend method.

Can you test whether the signal is emitted correctly by running the following in a terminal?
$ gdbus monitor --system --dest org.freedesktop.login1 \
                         --object-path /org/freedesktop/login1

Comment 2 Samuel Sieb 2016-02-04 20:53:24 UTC
# gdbus monitor --system --dest org.freedesktop.login1  --object-path /org/freedesktop/login1
Monitoring signals on object /org/freedesktop/login1 owned by org.freedesktop.login1
The name org.freedesktop.login1 is owned by :1.5
/org/freedesktop/login1: org.freedesktop.login1.Manager.PrepareForSleep (true,)
/org/freedesktop/login1: org.freedesktop.DBus.Properties.PropertiesChanged ('org.freedesktop.login1.Manager', {'DelayInhibited': <'shutdown:sleep'>}, @as [])
/org/freedesktop/login1: org.freedesktop.DBus.Properties.PropertiesChanged ('org.freedesktop.login1.Manager', {'DelayInhibited': <'shutdown:sleep'>}, @as [])
/org/freedesktop/login1: org.freedesktop.DBus.Properties.PropertiesChanged ('org.freedesktop.login1.Manager', {'DelayInhibited': <'shutdown:sleep'>}, @as [])
/org/freedesktop/login1: org.freedesktop.DBus.Properties.PropertiesChanged ('org.freedesktop.login1.Manager', {'DelayInhibited': <'shutdown:sleep'>}, @as [])
/org/freedesktop/login1: org.freedesktop.DBus.Properties.PropertiesChanged ('org.freedesktop.login1.Manager', {'DelayInhibited': <'sleep'>}, @as [])
/org/freedesktop/login1: org.freedesktop.login1.Manager.PrepareForSleep (false,)
/org/freedesktop/login1: org.freedesktop.DBus.Properties.PropertiesChanged ('org.freedesktop.login1.Manager', {'DelayInhibited': <'sleep'>}, @as [])
/org/freedesktop/login1: org.freedesktop.DBus.Properties.PropertiesChanged ('org.freedesktop.login1.Manager', {'DelayInhibited': <'shutdown:sleep'>}, @as [])
/org/freedesktop/login1: org.freedesktop.DBus.Properties.PropertiesChanged ('org.freedesktop.login1.Manager', {'DelayInhibited': <'shutdown:sleep'>}, @as [])
/org/freedesktop/login1: org.freedesktop.DBus.Properties.PropertiesChanged ('org.freedesktop.login1.Manager', {'DelayInhibited': <'shutdown:sleep'>}, @as [])
/org/freedesktop/login1: org.freedesktop.DBus.Properties.PropertiesChanged ('org.freedesktop.login1.Manager', {'DelayInhibited': <'shutdown:sleep'>}, @as [])
/org/freedesktop/login1: org.freedesktop.DBus.Properties.PropertiesChanged ('org.freedesktop.login1.Manager', {'DelayInhibited': <'shutdown:sleep'>}, @as [])
/org/freedesktop/login1: org.freedesktop.DBus.Properties.PropertiesChanged ('org.freedesktop.login1.Manager', {'DelayInhibited': <'shutdown:sleep'>}, @as [])

Comment 3 Fedora End Of Life 2016-11-24 15:16:47 UTC
This message is a reminder that Fedora 23 is nearing its end of life.
Approximately 4 (four) weeks from now Fedora will stop maintaining
and issuing updates for Fedora 23. It is Fedora's policy to close all
bug reports from releases that are no longer maintained. At that time
this bug will be closed as EOL if it remains open with a Fedora  'version'
of '23'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version.

Thank you for reporting this issue and we are sorry that we were not 
able to fix it before Fedora 23 is end of life. If you would still like 
to see this bug fixed and are able to reproduce it against a later version 
of Fedora, you are encouraged  change the 'version' to a later Fedora 
version prior this bug is closed as described in the policy above.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events. Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

Comment 4 Fedora End Of Life 2016-12-20 18:18:13 UTC
Fedora 23 changed to end-of-life (EOL) status on 2016-12-20. Fedora 23 is
no longer maintained, which means that it will not receive any further
security or bug fix updates. As a result we are closing this bug.

If you can reproduce this bug against a currently maintained version of
Fedora please feel free to reopen this bug against that version. If you
are unable to reopen this bug, please file a new report against the
current release. If you experience problems, please add a comment to this
bug.

Thank you for reporting this bug and we are sorry it could not be fixed.


Note You need to log in before you can comment on or make changes to this bug.