aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBjörn Esser <besser82@fedoraproject.org>2018-03-15 02:31:35 +0100
committerMike Gabriel <mike.gabriel@das-netzwerkteam.de>2018-03-16 16:19:03 +0100
commit897df0e4070364923b3d751f4b72b8d5315c04fa (patch)
tree8e6e3943487e96d19698337c2581198d4cbc06b5
parentcfec4f6641bcf992b42310accb85224b48f0960b (diff)
downloadarctica-greeter-897df0e4070364923b3d751f4b72b8d5315c04fa.tar.gz
arctica-greeter-897df0e4070364923b3d751f4b72b8d5315c04fa.tar.bz2
arctica-greeter-897df0e4070364923b3d751f4b72b8d5315c04fa.zip
main-window: Calculate the really needed screen size properly
-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);
}