aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/main-window.vala24
1 files changed, 22 insertions, 2 deletions
diff --git a/src/main-window.vala b/src/main-window.vala
index 99c0a1b..3240bc1 100644
--- a/src/main-window.vala
+++ b/src/main-window.vala
@@ -32,6 +32,8 @@ public class MainWindow : Gtk.Window
private Gtk.Box hbox;
private Gtk.Button back_button;
private ShutdownDialog? shutdown_dialog = null;
+ private int window_size_x;
+ private int window_size_y;
public ListStack stack;
@@ -148,6 +150,10 @@ public class MainWindow : Gtk.Window
add_user_list ();
+ window_size_x = 0;
+ window_size_y = 0;
+ primary_monitor = null;
+
if (ArcticaGreeter.singleton.test_mode)
{
/* Simulate an 800x600 monitor to the left of a 640x480 monitor */
@@ -220,7 +226,9 @@ public class MainWindow : Gtk.Window
Gdk.Rectangle geometry;
Gdk.Monitor primary = display.get_primary_monitor();
geometry = primary.get_geometry();
- debug ("Screen is %dx%d pixels", geometry.width, geometry.height);
+
+ window_size_x = 0;
+ window_size_y = 0;
monitors = new List<Monitor> ();
primary_monitor = null;
@@ -231,6 +239,16 @@ public class MainWindow : Gtk.Window
geometry = monitor.get_geometry ();
debug ("Monitor %d is %dx%d pixels at %d,%d", i, geometry.width, geometry.height, geometry.x, geometry.y);
+ if (window_size_x < geometry.x + geometry.width)
+ {
+ window_size_x = geometry.x + geometry.width;
+ }
+
+ if (window_size_y < geometry.y + geometry.height)
+ {
+ window_size_y = geometry.y + geometry.height;
+ }
+
if (monitor_is_unique_position (display, i))
{
var greeter_monitor = new Monitor (geometry.x, geometry.y, geometry.width, geometry.height);
@@ -241,8 +259,10 @@ public class MainWindow : Gtk.Window
}
}
+ debug ("MainWindow is %dx%d pixels", window_size_x, window_size_y);
+
background.set_monitors (monitors);
- resize (screen.get_width (), screen.get_height ());
+ resize (window_size_x, window_size_y);
move (0, 0);
move_to_monitor (primary_monitor);
}