From 3a5ca24831d1b4a74af6cfd5c5cc2a42b5787aeb Mon Sep 17 00:00:00 2001 From: Mike Gabriel Date: Wed, 3 May 2023 15:44:24 +0200 Subject: main-window: Smooth transition to greeter screen. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This completes a ported patch from slick-greeter. Credits to Björn Esser. From 5d39cade1f70ffe0a9bc38ad0b405bb55d98a505 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Esser?= Date: Wed, 29 Nov 2017 18:24:15 +0100 Subject: [PATCH] main-window: Calculate the really needed screen size properly (#84) * main-window: Calculate the really needed screen size properly * arctica-greeter: Smooth transition to the greeter screen --- src/background.vala | 1 + src/main-window.vala | 22 +++++++++++++++++++--- 2 files changed, 20 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/background.vala b/src/background.vala index 31d3057..d533274 100644 --- a/src/background.vala +++ b/src/background.vala @@ -478,6 +478,7 @@ public class Background : Gtk.Fixed private Monitor? active_monitor = null; private AnimateTimer timer; + load_background (null); private BackgroundLoader current; private BackgroundLoader old; diff --git a/src/main-window.vala b/src/main-window.vala index 5dd5a9a..cf7042e 100644 --- a/src/main-window.vala +++ b/src/main-window.vala @@ -36,6 +36,7 @@ public class MainWindow : Gtk.Window private ShutdownDialog? shutdown_dialog = null; private int window_size_x; private int window_size_y; + private bool do_resize; public ListStack stack; @@ -158,6 +159,7 @@ public class MainWindow : Gtk.Window window_size_x = 0; window_size_y = 0; primary_monitor = null; + do_resize = false; only_on_monitor = AGSettings.get_string(AGSettings.KEY_ONLY_ON_MONITOR); monitor_setting_ok = only_on_monitor == "auto"; @@ -216,6 +218,14 @@ public class MainWindow : Gtk.Window menubar.cleanup(); } + /* Setup the size and position of the window */ + public void setup_window () + { + resize (window_size_x, window_size_y); + move (0, 0); + move_to_monitor (primary_monitor); + } + public override void realize () { base.realize (); @@ -275,9 +285,15 @@ public class MainWindow : Gtk.Window debug ("MainWindow is %dx%d pixels", window_size_x, window_size_y); background.set_monitors (monitors); - resize (window_size_x, window_size_y); - move (0, 0); - move_to_monitor (primary_monitor); + + if(do_resize) + { + setup_window (); + } + else + { + do_resize = true; + } } /* Check if a monitor has a unique position */ -- cgit v1.2.3