From d089cffa6206ebfaf78f1189a1257b8cbe972b63 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Danielle=20For=C3=A9?= Date: Tue, 1 Apr 2025 11:09:13 -0700 Subject: [PATCH] Don't set window position --- data/io.elementary.monitor.gschema.xml | 10 ---------- src/MainWindow.vala | 14 +------------- 2 files changed, 1 insertion(+), 23 deletions(-) diff --git a/data/io.elementary.monitor.gschema.xml b/data/io.elementary.monitor.gschema.xml index 7b72b63b..8a174d2e 100644 --- a/data/io.elementary.monitor.gschema.xml +++ b/data/io.elementary.monitor.gschema.xml @@ -20,16 +20,6 @@ Window height Window height - - -1 - Window X position - Window X position - - - -1 - Window Y position - Window Y position - false To show Monitor Indicator or not diff --git a/src/MainWindow.vala b/src/MainWindow.vala index c216b18f..47e739a2 100644 --- a/src/MainWindow.vala +++ b/src/MainWindow.vala @@ -98,13 +98,10 @@ public class Monitor.MainWindow : Hdy.ApplicationWindow { key_press_event.connect ((e) => shortcuts.handle (e)); this.delete_event.connect (() => { - int window_width, window_height, position_x, position_y; + int window_width, window_height; get_size (out window_width, out window_height); - get_position (out position_x, out position_y); MonitorApp.settings.set_int ("window-width", window_width); MonitorApp.settings.set_int ("window-height", window_height); - MonitorApp.settings.set_int ("position-x", position_x); - MonitorApp.settings.set_int ("position-y", position_y); MonitorApp.settings.set_boolean ("is-maximized", this.is_maximized); MonitorApp.settings.set_string ("opened-view", stack.visible_child_name); @@ -131,15 +128,6 @@ public class Monitor.MainWindow : Hdy.ApplicationWindow { if (MonitorApp.settings.get_boolean ("is-maximized")) { this.maximize (); } - - int position_x = MonitorApp.settings.get_int ("position-x"); - int position_y = MonitorApp.settings.get_int ("position-y"); - if (position_x == -1 || position_y == -1) { - // -1 is default value of these keys, which means this is the first launch - this.window_position = Gtk.WindowPosition.CENTER; - } else { - move (position_x, position_y); - } } }