aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMike Gabriel <mike.gabriel@das-netzwerkteam.de>2023-05-03 15:44:24 +0200
committerMike Gabriel <mike.gabriel@das-netzwerkteam.de>2023-05-03 15:45:46 +0200
commit3a5ca24831d1b4a74af6cfd5c5cc2a42b5787aeb (patch)
tree7158a3391f4b7b7b04886df0a6ede33a56ba1775 /src
parent2614224219792ae5baabb2e958ce768fdd4a7758 (diff)
downloadarctica-greeter-3a5ca24831d1b4a74af6cfd5c5cc2a42b5787aeb.tar.gz
arctica-greeter-3a5ca24831d1b4a74af6cfd5c5cc2a42b5787aeb.tar.bz2
arctica-greeter-3a5ca24831d1b4a74af6cfd5c5cc2a42b5787aeb.zip
main-window: Smooth transition to greeter screen.
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?= <besser82@fedoraproject.org> 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
Diffstat (limited to 'src')
-rw-r--r--src/background.vala1
-rw-r--r--src/main-window.vala22
2 files changed, 20 insertions, 3 deletions
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 */