Skip to content

Commit fed3ebb

Browse files
danirabbitstsdc
andauthored
Don't set window position (#422)
Co-authored-by: Stanisław <[email protected]>
1 parent 6f5e935 commit fed3ebb

File tree

2 files changed

+1
-23
lines changed

2 files changed

+1
-23
lines changed

data/io.elementary.monitor.gschema.xml

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -20,16 +20,6 @@
2020
<summary>Window height</summary>
2121
<description>Window height</description>
2222
</key>
23-
<key type="i" name="position-x">
24-
<default>-1</default>
25-
<summary>Window X position</summary>
26-
<description>Window X position</description>
27-
</key>
28-
<key type="i" name="position-y">
29-
<default>-1</default>
30-
<summary>Window Y position</summary>
31-
<description>Window Y position</description>
32-
</key>
3323
<key type='b' name="indicator-state">
3424
<default>false</default>
3525
<summary>To show Monitor Indicator or not</summary>

src/MainWindow.vala

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -127,13 +127,10 @@ public class Monitor.MainWindow : Hdy.ApplicationWindow {
127127
key_press_event.connect ((e) => shortcuts.handle (e));
128128

129129
this.delete_event.connect (() => {
130-
int window_width, window_height, position_x, position_y;
130+
int window_width, window_height;
131131
get_size (out window_width, out window_height);
132-
get_position (out position_x, out position_y);
133132
MonitorApp.settings.set_int ("window-width", window_width);
134133
MonitorApp.settings.set_int ("window-height", window_height);
135-
MonitorApp.settings.set_int ("position-x", position_x);
136-
MonitorApp.settings.set_int ("position-y", position_y);
137134
MonitorApp.settings.set_boolean ("is-maximized", this.is_maximized);
138135

139136
MonitorApp.settings.set_string ("opened-view", stack.visible_child_name);
@@ -160,15 +157,6 @@ public class Monitor.MainWindow : Hdy.ApplicationWindow {
160157
if (MonitorApp.settings.get_boolean ("is-maximized")) {
161158
this.maximize ();
162159
}
163-
164-
int position_x = MonitorApp.settings.get_int ("position-x");
165-
int position_y = MonitorApp.settings.get_int ("position-y");
166-
if (position_x == -1 || position_y == -1) {
167-
// -1 is default value of these keys, which means this is the first launch
168-
this.window_position = Gtk.WindowPosition.CENTER;
169-
} else {
170-
move (position_x, position_y);
171-
}
172160
}
173161

174162
}

0 commit comments

Comments
 (0)