Skip to content

Commit e671fdf

Browse files
committed
screensaver: Reset internal state for new sessions, don't set the
state in wayland sessions.
1 parent 3e61da0 commit e671fdf

2 files changed

Lines changed: 9 additions & 1 deletion

File tree

js/ui/main.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -539,6 +539,14 @@ function start() {
539539
}
540540
});
541541

542+
if (!global.session_running || Meta.is_wayland_compositor()) {
543+
// If the session is *not* already running, clear the internal locked
544+
// state. This is used in x11 sessions to restore the screensaver after
545+
// cinnamon restarts. Wayland doesn't support restarts (yet) so it should
546+
// always be false.
547+
global.settings.set_boolean("session-locked-state", false);
548+
}
549+
542550
_screensaverSettings = new Gio.Settings({ schema_id: 'org.cinnamon.desktop.screensaver' });
543551

544552
// The internal screensaver is the only option for wayland sessions. X11 sessions can use either

js/ui/screensaver/screenShield.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,7 @@ var ScreenShield = GObject.registerClass({
223223

224224
let locked = newState === State.LOCKED || newState === State.UNLOCKING;
225225
let wasLocked = oldState === State.LOCKED || oldState === State.UNLOCKING;
226-
if (locked !== wasLocked) {
226+
if (locked !== wasLocked && !Metа.is_wayland_compositor()) {
227227
global.settings.set_boolean('session-locked-state', locked);
228228
}
229229

0 commit comments

Comments
 (0)