Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gschema: remove window position #802

Merged
merged 1 commit into from
Nov 10, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 0 additions & 5 deletions data/io.elementary.calendar.gschema.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,6 @@
<summary>Whether the window was maximized on last run</summary>
<description>Whether the window was maximized on last run</description>
</key>
<key name="window-position" type="(ii)">
<default>(-1, -1)</default>
<summary>Window position</summary>
<description>Most recent window position (x, y)</description>
</key>
<key name="window-size" type="(ii)">
<default>(1024, 750)</default>
<summary>Most recent window size</summary>
Expand Down
7 changes: 0 additions & 7 deletions src/Application.vala
Original file line number Diff line number Diff line change
Expand Up @@ -138,20 +138,13 @@ namespace Maya {
* Initializes the graphical window and its components
*/
void init_gui () {
int window_x, window_y;
var rect = Gtk.Allocation ();

saved_state.get ("window-position", "(ii)", out window_x, out window_y);
saved_state.get ("window-size", "(ii)", out rect.width, out rect.height);

window = new MainWindow (this);
window.title = _(Build.APP_NAME);
window.set_allocation (rect);

if (window_x != -1 || window_y != -1) {
window.move (window_x, window_y);
}

if (saved_state.get_boolean ("window-maximized")) {
window.maximize ();
}
Expand Down
4 changes: 0 additions & 4 deletions src/MainWindow.vala
Original file line number Diff line number Diff line change
Expand Up @@ -149,10 +149,6 @@ public class Maya.MainWindow : Hdy.ApplicationWindow {
Gdk.Rectangle rect;
get_allocation (out rect);
Maya.Application.saved_state.set ("window-size", "(ii)", rect.width, rect.height);

int root_x, root_y;
get_position (out root_x, out root_y);
Maya.Application.saved_state.set ("window-position", "(ii)", root_x, root_y);
}

return GLib.Source.REMOVE;
Expand Down