[gtk+] window: Remember current size



commit c4dc0e8e40e2144d84810f7603c9d1552e25fb43
Author: Benjamin Otte <otte redhat com>
Date:   Tue Apr 9 12:08:08 2013 +0200

    window: Remember current size
    
    Don't just look at previously remembered sizes, also look at the current
    size.
    This is useful for cases where the window was resized by the user or WM
    and not by the application itself.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=696882

 gtk/gtkwindow.c |    9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)
---
diff --git a/gtk/gtkwindow.c b/gtk/gtkwindow.c
index d929164..49212f8 100644
--- a/gtk/gtkwindow.c
+++ b/gtk/gtkwindow.c
@@ -5605,10 +5605,19 @@ gtk_window_get_remembered_size (GtkWindow *window,
                                 int       *height)
 {
   GtkWindowGeometryInfo *info;
+  GdkWindow *gdk_window;
 
   *width = 0;
   *height = 0;
 
+  gdk_window = gtk_widget_get_window (GTK_WIDGET (window));
+  if (gdk_window)
+    {
+      *width = gdk_window_get_width (gdk_window);
+      *height = gdk_window_get_height (gdk_window);
+      return;
+    }
+
   info = gtk_window_get_geometry_info (window, FALSE);
   if (info)
     {


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