diff --git a/data/io.elementary.desktop.wm.shell b/data/io.elementary.desktop.wm.shell index b0cca77c5..d4a69d123 100644 --- a/data/io.elementary.desktop.wm.shell +++ b/data/io.elementary.desktop.wm.shell @@ -1,7 +1,25 @@ [io.elementary.wingpanel] launch-on-x=true args=io.elementary.wingpanel +session-type=desktop [io.elementary.dock] launch-on-x=true args=io.elementary.dock +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 diff --git a/lib/SessionSettings.vala b/lib/SessionSettings.vala new file mode 100644 index 000000000..b3e82e429 --- /dev/null +++ b/lib/SessionSettings.vala @@ -0,0 +1,69 @@ +/* + * Copyright 2026 elementary, Inc. (https://elementary.io) + * SPDX-License-Identifier: GPL-3.0-or-later + * + * Authored by: Leonhard Kargl + */ + +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 string get_shell_clients_type () { + switch (get_session_type ()) { + case DESKTOP: + return "desktop"; + case GREETER: + return "greeter"; + case INSTALLER: + return "installer"; + } + + return "desktop"; + } + + public bool should_set_xdg_current_desktop () { + return get_session_type () != DESKTOP; + } + + public bool should_animate_panels () { + /* In the other types we fade in anyways */ + return get_session_type () == DESKTOP; + } + + public bool should_blur_background () { + return get_session_type () != DESKTOP; + } + + public bool should_fade_in () { + return get_session_type () != DESKTOP; + } +} diff --git a/lib/meson.build b/lib/meson.build index ee073287e..6dd7a59e8 100644 --- a/lib/meson.build +++ b/lib/meson.build @@ -8,6 +8,7 @@ gala_lib_sources = files( 'Constants.vala', 'DragDropAction.vala', 'Plugin.vala', + 'SessionSettings.vala', 'Utils.vala', 'WindowManager.vala', 'AppSystem/App.vala', diff --git a/src/Background/BackgroundContainer.vala b/src/Background/BackgroundContainer.vala index 8c2996385..983da800b 100644 --- a/src/Background/BackgroundContainer.vala +++ b/src/Background/BackgroundContainer.vala @@ -54,6 +54,10 @@ public class Gala.BackgroundContainer : Meta.BackgroundGroup { for (var i = 0; i < display.get_n_monitors (); i++) { var background = new BackgroundManager (display, i); + if (SessionSettings.should_blur_background ()) { + background.add_effect (new BlurEffect (background, 18)); + } + add_child (background); if (i == 0) diff --git a/src/Main.vala b/src/Main.vala index 420e33b7b..bd4179a2a 100644 --- a/src/Main.vala +++ b/src/Main.vala @@ -27,6 +27,12 @@ namespace Gala { } public static int main (string[] args) { + if (SessionSettings.should_set_xdg_current_desktop ()) { + // Ensure we present ourselves as Pantheon so we pick up the right GSettings + // overrides + Environment.set_variable ("XDG_CURRENT_DESKTOP", "Pantheon", true); + } + GLib.Intl.setlocale (LocaleCategory.ALL, ""); GLib.Intl.bindtextdomain (Config.GETTEXT_PACKAGE, Config.LOCALEDIR); GLib.Intl.bind_textdomain_codeset (Config.GETTEXT_PACKAGE, "UTF-8"); diff --git a/src/ShellClients/ShellClientsManager.vala b/src/ShellClients/ShellClientsManager.vala index 84594cbad..2ceb012ad 100644 --- a/src/ShellClients/ShellClientsManager.vala +++ b/src/ShellClients/ShellClientsManager.vala @@ -101,6 +101,15 @@ public class Gala.ShellClientsManager : Object, GestureTarget { } } + try { + var type = key_file.get_string (group, "session-type"); + if (type != SessionSettings.get_shell_clients_type ()) { + continue; + } + } catch (Error e) { + warning ("Failed to check session type for client %s, assuming it should be launched: %s", group, e.message); + } + try { var args = key_file.get_string_list (group, "args"); protocol_clients += new ManagedClient (wm.get_display (), args); @@ -109,6 +118,11 @@ public class Gala.ShellClientsManager : Object, GestureTarget { } } + if (!SessionSettings.should_animate_panels ()) { + starting_panels = 0; + return; + } + starting_panels = protocol_clients.length; } diff --git a/src/WindowManager.vala b/src/WindowManager.vala index 6a0ec38d4..316f69919 100644 --- a/src/WindowManager.vala +++ b/src/WindowManager.vala @@ -139,6 +139,10 @@ namespace Gala { show_stage (); + if (SessionSettings.should_fade_in ()) { + fade_in.begin (); + } + init_a11y (); AccessDialog.watch_portal (); @@ -418,6 +422,22 @@ namespace Gala { }); } + private async void fade_in () { + var fade_in_actor = new Clutter.Actor () { + background_color = { 0, 0, 0, 255 }, + }; + fade_in_actor.add_constraint (new Clutter.BindConstraint (stage, SIZE, 0)); + stage.add_child (fade_in_actor); + + /* TODO: We might want to wait another second before we start the fade otherwise it's not really visible */ + + var transition_builder = new TransitionBuilder (fade_in_actor, 1000, EASE); + transition_builder.add_property ("opacity", 0u); + yield transition_builder.run (); + + stage.remove_child (fade_in_actor); + } + private void init_a11y () { if (!Clutter.get_accessibility_enabled ()) { warning ("Clutter has no accessibility enabled");