-
-
Notifications
You must be signed in to change notification settings - Fork 80
Implement the greeter #2854
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Implement the greeter #2854
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
1a8467b
ModalProxy: Explicitly allow window groups
leolost2605 2b8f0f1
ShellClients: Add a wait for n panels key
leolost2605 6154e70
Add SessionSettings
leolost2605 7e8d665
Introduce LockScreen
leolost2605 7d86bf6
Introduce LockScreenManager
leolost2605 cf458d0
WindowManager: Integrate with lock screen
leolost2605 2ba273f
Allow to launch only specific shell clients based on session type
leolost2605 5759717
ShellClients: Add clients required for greeter
leolost2605 3a6006a
ShellClientsManager: Integrate with lock screen
leolost2605 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,7 +1,27 @@ | ||
| [io.elementary.wingpanel] | ||
| launch-on-x=true | ||
| args=io.elementary.wingpanel | ||
| wait-for-n-panels=1 | ||
| session-type=desktop | ||
|
|
||
| [io.elementary.dock] | ||
| launch-on-x=true | ||
| args=io.elementary.dock | ||
| wait-for-n-panels=1 | ||
| session-type=desktop | ||
|
|
||
| [Greeter wingpanel] | ||
| args=io.elementary.wingpanel;-g | ||
| session-type=greeter | ||
|
|
||
| [Greeter Session Manager] | ||
| args=io.elementary.greeter-session-manager | ||
| session-type=greeter | ||
|
|
||
| [Greeter] | ||
| args=io.elementary.greeter | ||
| session-type=greeter | ||
|
|
||
| [Greeter Settings Daemon] | ||
| args=io.elementary.settings-daemon | ||
| session-type=greeter |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,56 @@ | ||
| /* | ||
| * Copyright 2026 elementary, Inc. (https://elementary.io) | ||
| * SPDX-License-Identifier: GPL-3.0-or-later | ||
| * | ||
| * Authored by: Leonhard Kargl <leo.kargl@proton.me> | ||
| */ | ||
|
|
||
| namespace Gala.SessionSettings { | ||
| private enum SessionType { | ||
| DESKTOP, | ||
| GREETER, | ||
| INSTALLER; | ||
| } | ||
|
|
||
| private static SessionType? session_type = null; | ||
|
|
||
| private static SessionType get_session_type () { | ||
| if (session_type == null) { | ||
| var session_type_str = Environment.get_variable ("GALA_SESSION_TYPE") ?? "desktop"; | ||
| switch (session_type_str) { | ||
| case "desktop": | ||
| session_type = DESKTOP; | ||
| break; | ||
| case "greeter": | ||
| session_type = GREETER; | ||
| break; | ||
| case "installer": | ||
| session_type = INSTALLER; | ||
| break; | ||
| default: | ||
| warning ("Unknown session type: %s", session_type_str); | ||
| session_type = DESKTOP; | ||
| break; | ||
| } | ||
| } | ||
|
|
||
| return session_type; | ||
| } | ||
|
|
||
| public bool is_greeter () { | ||
| return get_session_type () != DESKTOP; | ||
| } | ||
|
|
||
| public string get_shell_clients_type () { | ||
| switch (get_session_type ()) { | ||
| case DESKTOP: | ||
| return "desktop"; | ||
| case GREETER: | ||
| return "greeter"; | ||
| case INSTALLER: | ||
| return "installer"; | ||
| } | ||
|
|
||
| return "desktop"; | ||
| } | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,29 @@ | ||
| /* | ||
| * Copyright 2026 elementary, Inc. (https://elementary.io) | ||
| * SPDX-License-Identifier: GPL-3.0-or-later | ||
| * | ||
| * Authored by: Leonhard Kargl <leo.kargl@proton.me> | ||
| */ | ||
|
|
||
| public class Gala.LockScreenManager : Object { | ||
| public LockScreen lock_screen { private get; construct; } | ||
|
|
||
| /** | ||
| * To be set by the session locker in the future when we have an in session lock screen | ||
| */ | ||
| public bool manually_locked { get; set; default = false; } | ||
|
|
||
| public LockScreenManager (LockScreen lock_screen) { | ||
| Object (lock_screen: lock_screen); | ||
| } | ||
|
|
||
| construct { | ||
| notify["manually-locked"].connect (update_active); | ||
| update_active (); | ||
| } | ||
|
|
||
| private void update_active () { | ||
| var active = manually_locked || SessionSettings.is_greeter (); | ||
| lock_screen.set_active.begin (active); | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,68 @@ | ||
| /* | ||
| * Copyright 2026 elementary, Inc. (https://elementary.io) | ||
| * SPDX-License-Identifier: GPL-3.0-or-later | ||
| * | ||
| * Authored by: Leonhard Kargl <leo.kargl@proton.me> | ||
| */ | ||
|
|
||
| public class Gala.LockScreen : Clutter.Actor { | ||
| private const WindowGroup[] ALLOWED_WINDOW_GROUPS = { LOCK_SCREEN, LOCK_SCREEN_SHELL, OVERLAY }; | ||
|
|
||
| public WindowManager wm { get; construct; } | ||
|
|
||
| public Clutter.Actor window_group { get; private set; } | ||
| public Clutter.Actor shell_group { get; private set; } | ||
|
|
||
| private bool active; | ||
| private ModalProxy? modal_proxy; | ||
|
|
||
| public LockScreen (WindowManager wm) { | ||
| Object (wm: wm); | ||
| } | ||
|
|
||
| construct { | ||
| var background = new BackgroundContainer (wm.get_display ()); | ||
| background.add_effect (new BlurEffect (background, 18)); | ||
|
|
||
| window_group = new Clutter.Actor (); | ||
| shell_group = new Clutter.Actor (); | ||
|
|
||
| add_child (background); | ||
| add_child (window_group); | ||
| add_child (shell_group); | ||
|
|
||
| reactive = true; | ||
| visible = true; | ||
|
|
||
| active = true; | ||
| update_modal (); | ||
| } | ||
|
|
||
| public async void set_active (bool active) { | ||
| if (this.active == active) { | ||
| return; | ||
| } | ||
|
|
||
| this.active = active; | ||
| update_modal (); | ||
|
|
||
| /* We can and should add a transition here */ | ||
|
|
||
| visible = active; | ||
| } | ||
|
|
||
| private void update_modal () { | ||
| if (active) { | ||
| assert (modal_proxy == null); | ||
|
|
||
| modal_proxy = wm.push_modal (this, false); | ||
| modal_proxy.allow_actions (MEDIA_KEYS | ZOOM | LOCATE_POINTER); | ||
| modal_proxy.allow_window_groups (ALLOWED_WINDOW_GROUPS); | ||
| } else { | ||
| assert (modal_proxy != null); | ||
|
|
||
| wm.pop_modal (modal_proxy); | ||
| modal_proxy = null; | ||
| } | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is the installer type necessary? I don't see it used anywhere, and is also rolled into greeter type when is_greeter is called.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The greeter compositor launches different clients depending on whether it's a normal greeter session or a installer session (it doesn't launch the greeter, session manager, etc. in the installer session) that's why I added it here but I'm not familiar with the installer session and I haven't tested it 🤷