GNOME Bugzilla – Bug 687020
Screen shield is not lowered on automatic suspend, session can never be unlocked on resume
Last modified: 2012-11-05 21:08:33 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.
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)
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.
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.
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.
(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.
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
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?
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.
I've observed this problem recently. When it happens to me, calling loginctl unlock-session from another vt successfully unlocks the session.
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.
So, is this good to commit or not?
I don't know. I'd rather design better logic and have better investigation into how it worked than just break the cycle.
Attachment 227454 [details] pushed as 1c3e733 - ScreenShield: don't rely on gnome-session to hide the lightbox