[gedit] Save window size properly



commit f7918d9a8bb695cf5c7e6a829da17bdb79c24f2b
Author: Matthias Clasen <mclasen redhat com>
Date:   Wed Feb 24 06:49:21 2016 -0500

    Save window size properly
    
    This is following the current best practice as layed out in
    https://wiki.gnome.org/HowDoI/SaveWindowState. It is important
    to use gtk_window_get_size, otherwise the window will grow
    under Wayland.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=762600

 gedit/gedit-window.c |    7 +------
 1 files changed, 1 insertions(+), 6 deletions(-)
---
diff --git a/gedit/gedit-window.c b/gedit/gedit-window.c
index 73dc81f..c4f13a9 100644
--- a/gedit/gedit-window.c
+++ b/gedit/gedit-window.c
@@ -168,12 +168,7 @@ save_window_state (GtkWidget *widget)
        if ((window->priv->window_state &
            (GDK_WINDOW_STATE_MAXIMIZED | GDK_WINDOW_STATE_FULLSCREEN)) == 0)
        {
-               GtkAllocation allocation;
-
-               gtk_widget_get_allocation (widget, &allocation);
-
-               window->priv->width = allocation.width;
-               window->priv->height = allocation.height;
+                gtk_window_get_size (GTK_WINDOW (widget), &window->priv->width, &window->priv->height);
 
                g_settings_set (window->priv->window_settings, GEDIT_SETTINGS_WINDOW_SIZE,
                                "(ii)", window->priv->width, window->priv->height);


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