From a94813966fed8f6070d340b892ead00b741d93f7 Mon Sep 17 00:00:00 2001 From: lenemter Date: Fri, 9 Feb 2024 19:27:40 +0900 Subject: [PATCH 1/2] Simpler fade-in animation --- compositor/WindowManager.vala | 19 ++++++++++++++++++- src/Application.vala | 4 ++-- 2 files changed, 20 insertions(+), 3 deletions(-) diff --git a/compositor/WindowManager.vala b/compositor/WindowManager.vala index 65028ce0a..78165683d 100644 --- a/compositor/WindowManager.vala +++ b/compositor/WindowManager.vala @@ -46,7 +46,9 @@ namespace GreeterCompositor { public Greeter.SystemBackground system_background { get; private set; } - Meta.PluginInfo info; + private Clutter.Actor? fade_in_screen = null; + + private Meta.PluginInfo info; // Used to toggle screenreader private GLib.Settings application_settings; @@ -76,6 +78,12 @@ namespace GreeterCompositor { public override void start () { show_stage (); + fade_in_screen.save_easing_state (); + fade_in_screen.set_easing_duration (1000); + fade_in_screen.set_easing_mode (Clutter.AnimationMode.EASE); + fade_in_screen.opacity = 0; + fade_in_screen.restore_easing_state (); + unowned Meta.Display display = get_display (); display.gl_video_memory_purged.connect (() => { refresh_background (); @@ -124,6 +132,15 @@ namespace GreeterCompositor { pointer_locator = new PointerLocator (this); ui_group.add_child (pointer_locator); + int width, height; + display.get_size (out width, out height); + fade_in_screen = new Clutter.Actor () { + width = width, + height = height, + background_color = Clutter.Color.from_rgba (0, 0, 0, 255), + }; + stage.add_child (fade_in_screen); + MaskCorners.init (this); /*keybindings*/ diff --git a/src/Application.vala b/src/Application.vala index 9695b4532..c107f55a0 100644 --- a/src/Application.vala +++ b/src/Application.vala @@ -32,8 +32,6 @@ public int main (string[] args) { var settings_daemon = new Greeter.SettingsDaemon (); settings_daemon.start (); - Gtk.init (ref args); - Greeter.SubprocessSupervisor compositor; Greeter.SubprocessSupervisor wingpanel; @@ -43,6 +41,8 @@ public int main (string[] args) { critical (e.message); } + Gtk.init (ref args); + var window = new Greeter.MainWindow (); window.show_all (); From f6036f333ed7b1d644fc1af8072bcc6098aba866 Mon Sep 17 00:00:00 2001 From: Leo Date: Fri, 9 Feb 2024 23:37:49 +0900 Subject: [PATCH 2/2] Update compositor/WindowManager.vala --- compositor/WindowManager.vala | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/compositor/WindowManager.vala b/compositor/WindowManager.vala index 78165683d..7995e03fa 100644 --- a/compositor/WindowManager.vala +++ b/compositor/WindowManager.vala @@ -46,7 +46,7 @@ namespace GreeterCompositor { public Greeter.SystemBackground system_background { get; private set; } - private Clutter.Actor? fade_in_screen = null; + private Clutter.Actor fade_in_screen; private Meta.PluginInfo info;