[gnome-todo] window: Don't store window position



commit 851ed6a7ba0283d9de19767f3f3985dd8d26ad9a
Author: Georges Basile Stavracas Neto <georges stavracas gmail com>
Date:   Thu Mar 28 17:20:13 2019 -0300

    window: Don't store window position
    
    Wayland does not support setting nor retrieving the
    window position. GTK4 is Wayland-focused, and as such,
    dropped support for those concepts.

 data/org.gnome.todo.gschema.xml |  5 -----
 src/gtd-window.c                | 20 ++++++++------------
 2 files changed, 8 insertions(+), 17 deletions(-)
---
diff --git a/data/org.gnome.todo.gschema.xml b/data/org.gnome.todo.gschema.xml
index fe4bfe7..1cc459b 100644
--- a/data/org.gnome.todo.gschema.xml
+++ b/data/org.gnome.todo.gschema.xml
@@ -11,11 +11,6 @@
             <summary>Window size</summary>
             <description>Window size (width and height).</description>
         </key>
-        <key name="window-position" type="(ii)">
-            <default>(-1, -1)</default>
-            <summary>Window position</summary>
-            <description>Window position (x and y).</description>
-        </key>
         <key name="first-run" type="b">
             <default>true</default>
             <summary>First run of GNOME To Do</summary>
diff --git a/src/gtd-window.c b/src/gtd-window.c
index 4b38d7a..673bb6d 100644
--- a/src/gtd-window.c
+++ b/src/gtd-window.c
@@ -304,22 +304,19 @@ error_message_notification_secondary_action (GtdNotification *notification,
 static void
 load_geometry (GtdWindow *self)
 {
-  GdkRectangle geometry;
   GSettings *settings;
   GtkWindow *window;
   gboolean maximized;
+  gint height;
+  gint width;
 
   window = GTK_WINDOW (self);
   settings = gtd_manager_get_settings (gtd_manager_get_default ());
 
   maximized = g_settings_get_boolean (settings, "window-maximized");
-  g_settings_get (settings, "window-size", "(ii)", &geometry.width, &geometry.height);
-  g_settings_get (settings, "window-position", "(ii)", &geometry.x, &geometry.y);
+  g_settings_get (settings, "window-size", "(ii)", &width, &height);
 
-  gtk_window_set_default_size (window, geometry.width, geometry.height);
-
-  if (geometry.y > -1)
-    gtk_window_move (window, geometry.x, geometry.y);
+  gtk_window_set_default_size (window, width, height);
 
   if (maximized)
     gtk_window_maximize (window);
@@ -447,10 +444,11 @@ on_show_notification_cb (GtdManager      *manager,
 static void
 gtd_window_unmap (GtkWidget *widget)
 {
-  GdkRectangle geometry;
   GSettings *settings;
   GtkWindow *window;
   gboolean maximized;
+  gint height;
+  gint width;
 
   window = GTK_WINDOW (widget);
   settings = gtd_manager_get_settings (gtd_manager_get_default ());
@@ -461,10 +459,8 @@ gtd_window_unmap (GtkWidget *widget)
   if (maximized)
     return;
 
-  gtk_window_get_size (window, &geometry.width, &geometry.height);
-  gtk_window_get_position (window, &geometry.x, &geometry.y);
-  g_settings_set (settings, "window-size", "(ii)", geometry.width, geometry.height);
-  g_settings_set (settings, "window-position", "(ii)", geometry.x, geometry.y);
+  gtk_window_get_size (window, &width, &height);
+  g_settings_set (settings, "window-size", "(ii)", width, height);
 
   GTK_WIDGET_CLASS (gtd_window_parent_class)->unmap (widget);
 }


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]