Skip to content

Commit 7d86bf6

Browse files
committed
Introduce LockScreenManager
1 parent 7e8d665 commit 7d86bf6

3 files changed

Lines changed: 34 additions & 0 deletions

File tree

src/LockScreenManager.vala

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
/*
2+
* Copyright 2026 elementary, Inc. (https://elementary.io)
3+
* SPDX-License-Identifier: GPL-3.0-or-later
4+
*
5+
* Authored by: Leonhard Kargl <leo.kargl@proton.me>
6+
*/
7+
8+
public class Gala.LockScreenManager : Object {
9+
public LockScreen lock_screen { private get; construct; }
10+
11+
/**
12+
* To be set by the session locker in the future when we have an in session lock screen
13+
*/
14+
public bool manually_locked { get; set; default = false; }
15+
16+
public LockScreenManager (LockScreen lock_screen) {
17+
Object (lock_screen: lock_screen);
18+
}
19+
20+
construct {
21+
notify["manually-locked"].connect (update_active);
22+
update_active ();
23+
}
24+
25+
private void update_active () {
26+
var active = manually_locked || SessionSettings.is_greeter ();
27+
lock_screen.set_active.begin (active);
28+
}
29+
}

src/WindowManager.vala

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,8 @@ namespace Gala {
112112

113113
private NotificationStack notification_stack;
114114

115+
private LockScreenManager lock_screen_manager;
116+
115117
private Gee.LinkedList<ModalProxy> modal_stack = new Gee.LinkedList<ModalProxy> ();
116118

117119
private Gee.HashSet<Meta.WindowActor> minimizing = new Gee.HashSet<Meta.WindowActor> ();
@@ -319,6 +321,8 @@ namespace Gala {
319321
lock_screen.add_constraint (new Clutter.BindConstraint (stage, SIZE, 0));
320322
ui_group.add_child (lock_screen);
321323

324+
lock_screen_manager = new LockScreenManager (lock_screen);
325+
322326
modal_group = new ModalGroup (this, ShellClientsManager.get_instance ());
323327
modal_group.add_constraint (new Clutter.BindConstraint (stage, SIZE, 0));
324328
ui_group.add_child (modal_group);

src/meson.build

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ gala_bin_sources = files(
77
'InputMethod.vala',
88
'InternalUtils.vala',
99
'KeyboardManager.vala',
10+
'LockScreenManager.vala',
1011
'Main.vala',
1112
'NotificationsManager.vala',
1213
'NotificationStack.vala',

0 commit comments

Comments
 (0)