From cad592202de8c0ac6fa717f351729e7c9dbde3eb Mon Sep 17 00:00:00 2001 From: Geoff Paul Date: Wed, 3 May 2023 16:04:22 +0200 Subject: Add option to span background across multiple monitors --- src/main-window.vala | 23 +++-------------------- 1 file changed, 3 insertions(+), 20 deletions(-) (limited to 'src/main-window.vala') diff --git a/src/main-window.vala b/src/main-window.vala index cf7042e..fd1e19c 100644 --- a/src/main-window.vala +++ b/src/main-window.vala @@ -34,8 +34,6 @@ 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; private bool do_resize; public ListStack stack; @@ -156,8 +154,6 @@ public class MainWindow : Gtk.Window add_user_list (); - window_size_x = 0; - window_size_y = 0; primary_monitor = null; do_resize = false; @@ -173,7 +169,7 @@ public class MainWindow : Gtk.Window monitors.append (new Monitor (800, 120, 640, 480)); background.set_monitors (monitors); move_to_monitor (monitors.nth_data (0)); - resize (800 + 640, 600); + resize (background.width, background.height); } else { @@ -221,7 +217,7 @@ public class MainWindow : Gtk.Window /* Setup the size and position of the window */ public void setup_window () { - resize (window_size_x, window_size_y); + resize (background.width, background.height); move (0, 0); move_to_monitor (primary_monitor); } @@ -246,9 +242,6 @@ public class MainWindow : Gtk.Window Gdk.Monitor primary = display.get_primary_monitor(); geometry = primary.get_geometry(); - window_size_x = 0; - window_size_y = 0; - monitors = new List (); primary_monitor = null; @@ -258,16 +251,6 @@ 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); @@ -282,7 +265,7 @@ public class MainWindow : Gtk.Window } } - debug ("MainWindow is %dx%d pixels", window_size_x, window_size_y); + debug ("MainWindow is %dx%d pixels", background.width, background.height); background.set_monitors (monitors); -- cgit v1.2.3