After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 660267 - Suspend with media key doesn't properly lock screen
Suspend with media key doesn't properly lock screen
Status: RESOLVED FIXED
Product: gnome-settings-daemon
Classification: Core
Component: media-keys
3.2.x
Other Linux
: Normal normal
: ---
Assigned To: gnome-settings-daemon-maint
gnome-settings-daemon-maint
: 664005 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2011-09-27 17:33 UTC by Marc Deslauriers
Modified: 2011-11-14 14:10 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
patch to correct the issue (5.48 KB, patch)
2011-09-27 17:33 UTC, Marc Deslauriers
none Details | Review
Use the system bus. (1.46 KB, patch)
2011-10-20 06:51 UTC, Jan Alexander Steffens (heftig)
none Details | Review

Description Marc Deslauriers 2011-09-27 17:33:51 UTC
Created attachment 197589 [details] [review]
patch to correct the issue

When suspending with a media key, the screen doesn't properly get locked.

This is a similar issue to bug 655924

The attached patch fixes the problem.

See the downstream report:

https://bugs.launchpad.net/ubuntu/+source/gnome-settings-daemon/+bug/859498
Comment 1 Thomas Wouters 2011-10-07 18:15:41 UTC
This happens in Arch Linux too: pressing the power button on my laptop to suspend results in an unlocked session (only for a few seconds) after resuming.

I've tried the attached patch, and it seems to fix the problem for me.
Comment 2 Bastien Nocera 2011-10-07 20:44:17 UTC
commit edba2b53c947ad999898fa4183ec9db8e43d5d9b
Author: Bastien Nocera <hadess@hadess.net>
Date:   Fri Oct 7 21:40:18 2011 +0100

    media-keys: Fix suspend button not locking the screen
    
    Because we call UPower synchronously, so cannot process
    notifications during that time. Same bug as bug 655924,
    and same fix as 31fe6c18b9ca1034815e4cbffa6e6ea1336e4aec
    
    https://bugzilla.gnome.org/show_bug.cgi?id=660267
    
    Conflicts:
    
        configure.ac
Comment 3 Sebastien Bacher 2011-10-19 12:34:37 UTC
The commit there seems broken, 3.2.1 displays "couldn't sleep using UPower: ... The name org.freedesktop.UPower was not provided by any .service files" warnings in the session log

It does seem you try to connect to upower on the session bus where it's on the system one?
Comment 4 Ionut Biru 2011-10-19 14:11:11 UTC
confirmed.

(gnome-settings-daemon:1294): media-keys-plugin-WARNING **: couldn't sleep using UPower: GDBus.Error:org.freedesktop.DBus.Error.ServiceUnknown: The name org.freedesktop.UPower was not provided by any .service files
Comment 5 Jan Alexander Steffens (heftig) 2011-10-20 06:51:18 UTC
Created attachment 199501 [details] [review]
Use the system bus.

Patch to make it use the system bus instead. Suspend via key works again.
Comment 6 Ionut Biru 2011-10-20 06:58:59 UTC
patch from comment 5 makes suspend/hibernate from media key work but the original issue still exists.

the screen is not locked
Comment 7 Bastien Nocera 2011-10-20 08:07:41 UTC
(In reply to comment #5)
> Created an attachment (id=199501) [details] [review]
> Use the system bus.
> 
> Patch to make it use the system bus instead. Suspend via key works again.

I already fixed that in master and gnome-3-2 yesterday:
http://git.gnome.org/browse/gnome-settings-daemon/commit/?id=3b41d8d62ebef1070e4304ad40cf395d12834808

Ionut, if the problem persists with the upstream repo, please reopen the bug.
Comment 8 Ionut Biru 2011-10-20 08:28:29 UTC
I didn't had lock enabled in Screen panel. Definitely works
Comment 9 Bastien Nocera 2011-11-14 14:10:54 UTC
*** Bug 664005 has been marked as a duplicate of this bug. ***