[gtk+/gtk-3-16] window: fix initial shadow width for maximized/fullscreen windows

commit 7b2f3a0887f9d611dbf591a25f9bf80939cfb144
Author: Cosimo Cecchi <cosimo endlessm com>
Date:   Mon Apr 13 15:31:10 2015 -0700

    window: fix initial shadow width for maximized/fullscreen windows
    To calculate the shadow width, we look at the value of priv->fullscreen
    and priv->maximized.
    Those fields will have the actual value only after GTK receives back a
    window state event though, so they will be wrong in _realize(). Look at
    priv->fullscreen_initially and priv->maximize_initially too, to avoid
    the size changing right after realize, which would make the window
    flicker if maximized at startup.

 gtk/gtkwindow.c |    8 +++++++-
 1 files changed, 7 insertions(+), 1 deletions(-)
diff --git a/gtk/gtkwindow.c b/gtk/gtkwindow.c
index 53f74e8..3ec7e09 100644
--- a/gtk/gtkwindow.c
+++ b/gtk/gtkwindow.c
@@ -6012,6 +6012,8 @@ gtk_window_map (GtkWidget *widget)
     gdk_window_unmaximize (gdk_window);
+  priv->maximize_initially = FALSE;
   if (priv->stick_initially)
     gdk_window_stick (gdk_window);
@@ -6027,6 +6029,8 @@ gtk_window_map (GtkWidget *widget)
     gdk_window_unfullscreen (gdk_window);
+  priv->fullscreen_initially = FALSE;
   gdk_window_set_keep_above (gdk_window, priv->above_initially);
   gdk_window_set_keep_below (gdk_window, priv->below_initially);
@@ -6480,7 +6484,9 @@ get_shadow_width (GtkWidget *widget,
   if (priv->maximized ||
-      priv->fullscreen)
+      priv->maximize_initially ||
+      priv->fullscreen ||
+      priv->fullscreen_initially)
   if (!gtk_widget_is_toplevel (widget))

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