[nautilus/wip/antoniof/experimental-gtk4-build: 42/52] gtk_window_get_size() -> gtk_window_get_default_size()




commit 9f8aed7d7e4c1b20cff90a2636007d1d91ae2fd1
Author: António Fernandes <antoniof gnome org>
Date:   Fri Dec 31 17:57:46 2021 +0000

    gtk_window_get_size() -> gtk_window_get_default_size()
    
    The new method ignores maximized and tiled size, which is convenient.

 src/nautilus-window.c | 20 +-------------------
 1 file changed, 1 insertion(+), 19 deletions(-)
---
diff --git a/src/nautilus-window.c b/src/nautilus-window.c
index 3ce7ebb06..804abdbd4 100644
--- a/src/nautilus-window.c
+++ b/src/nautilus-window.c
@@ -2207,29 +2207,11 @@ nautilus_window_finalize (GObject *object)
 static void
 nautilus_window_save_geometry (NautilusWindow *window)
 {
-    GdkWindow *gdk_window;
-    GdkWindowState window_state;
     gint width;
     gint height;
     GVariant *initial_size;
 
-    g_assert (NAUTILUS_IS_WINDOW (window));
-
-    gdk_window = gtk_widget_get_window (GTK_WIDGET (window));
-    if (!gdk_window)
-    {
-        return;
-    }
-    window_state = gdk_window_get_state (gtk_widget_get_window (GTK_WIDGET (window)));
-    if (window_state & (GDK_WINDOW_STATE_TILED | GDK_WINDOW_STATE_MAXIMIZED))
-    {
-        /* Don't save the window state for tiled or maximized windows. In GTK
-         * gtk_window_get_default_size() is going to do this for us.
-         */
-        return;
-    }
-
-    gtk_window_get_size (GTK_WINDOW (window), &width, &height);
+    gtk_window_get_default_size (GTK_WINDOW (window), &width, &height);
     initial_size = g_variant_new_parsed ("(%i, %i)", width, height);
 
     g_settings_set_value (nautilus_window_state,


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