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 687020 - Screen shield is not lowered on automatic suspend, session can never be unlocked on resume
Screen shield is not lowered on automatic suspend, session can never be unloc...
Status: RESOLVED FIXED
Product: gnome-shell
Classification: Core
Component: lock-screen
3.6.x
Other Linux
: Normal critical
: ---
Assigned To: gnome-shell-maint
gnome-shell-maint
Depends on:
Blocks:
 
 
Reported: 2012-10-28 02:14 UTC by Jean-François Fortin Tam
Modified: 2012-11-05 21:08 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
ScreenShield: don't rely on gnome-session to hide the lightbox (3.41 KB, patch)
2012-10-28 11:34 UTC, Giovanni Campagna
none Details | Review
ScreenShield: don't rely on gnome-session to hide the lightbox (3.84 KB, patch)
2012-10-28 11:49 UTC, Giovanni Campagna
none Details | Review
ScreenShield: don't rely on gnome-session to hide the lightbox (4.42 KB, patch)
2012-10-28 11:50 UTC, Giovanni Campagna
committed Details | Review

Description Jean-François Fortin Tam 2012-10-28 02:14:22 UTC
I didn't find a bug report that matches exactly what I'm seeing here (even in the closed reports), so maybe it flew under the radar. This is with intel graphics and a fully updated Fedora 18 (GNOME 3.6.1). I'm not sure if this is gnome-shell or gdm or gnome-session acting up, the boundaries are a bit blurry these days.

How to trigger the bug:
1. Enable automatic screen locking. For testing purposes you can set it to 1 minute.
2. Enable automatic suspend. You can set it to 5 minutes.
3. Let it automatically suspend. The bug will NOT be triggered by manually triggering a suspend (which will lower the lock shield).

Symptoms:
- when resuming, you get a black screen with a mouse cursor. Mouse and keyboard events work
- the session lock shield is not shown (no wallpaper, no clock, etc.)
- gnome-shell's "panel" is not shown
- switching to another virtual terminal with ctrl+alt+F2, then running "service gdm restart" allows GDM to kill the X sessions and login again.

I initially thought this might have been caused by dualscreen setups, but it happens even without an external screen, keyboard and mouse plugged in.
Comment 1 Giovanni Campagna 2012-10-28 11:33:41 UTC
I think I found the problem:
- gnome-session goes IDLE, gnome-shell shows the black lightbox
- gnome-settings-daemon suspends, gnome-shell activates the lock screen
- gnome-session sees the screensaver is active, locks itself into IDLE
- deadlock

A solution is to have gnome-shell watch its own IdleMonitor.

(See also bug 685115, which if landed would solve this problem in a more specific way)
Comment 2 Giovanni Campagna 2012-10-28 11:34:47 UTC
Created attachment 227452 [details] [review]
ScreenShield: don't rely on gnome-session to hide the lightbox

If we lock before the user becomes active again, gnome-session will never
change presence from IDLE, and thus we'll never hide the lightbox.
Instead, install our own idle monitor.

This is for master (uses GnomeDesktop.IdleMonitor). I'll prepare a patch
for gnome-3-6 too.
Comment 3 Giovanni Campagna 2012-10-28 11:49:04 UTC
Created attachment 227453 [details] [review]
ScreenShield: don't rely on gnome-session to hide the lightbox

If we lock before the user becomes active again, gnome-session will never
change presence from IDLE, and thus we'll never hide the lightbox.
Instead, install our own idle monitor.

Ops, small bug caused by the isActive change.
Comment 4 Giovanni Campagna 2012-10-28 11:50:41 UTC
Created attachment 227454 [details] [review]
ScreenShield: don't rely on gnome-session to hide the lightbox

If we lock before the user becomes active again, gnome-session will never
change presence from IDLE, and thus we'll never hide the lightbox.
Instead, install our own idle monitor.

And this is the UNTESTED gnome-3-6 patch.
Comment 5 Jasper St. Pierre (not reading bugmail) 2012-10-28 13:42:52 UTC
(In reply to comment #2)
> If we lock before the user becomes active again, gnome-session will never
> change presence from IDLE

Why not? This seems like a gnome-session issue. It seems like locking before the user becomes active again is the normal thing.
Comment 6 Giovanni Campagna 2012-10-28 14:15:54 UTC
Well, this is how gnome-session has always worked, since GNOME 2.
Look at http://git.gnome.org/browse/gnome-session/tree/gnome-session/gsm-presence.c#n180
Comment 7 Jasper St. Pierre (not reading bugmail) 2012-10-28 14:24:07 UTC
I still don't understand the deadlock thing.

gnome-session uses the screensaver state to care about the session idleness, and gnome-shell uses the session state to care about... the screensaver state? Meaning we show the lightbox forever?

How did this ever work in the first place?
Comment 8 Giovanni Campagna 2012-10-28 14:29:12 UTC
Good question.
I think initially the screensaver interface was not wired enough (so gnome-session was not aware of the screenshield), and then it just went unnoticed.
Comment 9 Matthias Clasen 2012-10-29 00:50:47 UTC
I've observed this problem recently. When it happens to me, calling loginctl unlock-session from another vt successfully unlocks the session.
Comment 10 Matthias Clasen 2012-10-29 05:05:07 UTC
another way to end up with this unfixable idle is to just call

gdbus call --session --dest org.gnome.SessionManager --object-path /org/gnome/SessionManager/Presence --method org.gnome.SessionManager.Presence.SetStatus 3

This also nicely shows that the slow fade is not interruptible by user input, as it should be.
Comment 11 Giovanni Campagna 2012-11-05 18:23:15 UTC
So, is this good to commit or not?
Comment 12 Jasper St. Pierre (not reading bugmail) 2012-11-05 19:03:27 UTC
I don't know. I'd rather design better logic and have better investigation into how it worked than just break the cycle.
Comment 13 Giovanni Campagna 2012-11-05 21:08:25 UTC
Attachment 227454 [details] pushed as 1c3e733 - ScreenShield: don't rely on gnome-session to hide the lightbox