aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
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 */