[gtk+] window: Only avoid queueing resizes if the popover position didn't change



commit 25721ae3e7c679270351037ca4d02fb096579baf
Author: Carlos Garnacho <carlosg gnome org>
Date:   Fri Aug 1 16:50:59 2014 +0200

    window: Only avoid queueing resizes if the popover position didn't change
    
    If the same position is requested on a popover, it should at least ensure
    the window is realized and raised, even if no resizes are queued on the
    content. Otherwise other widgets being mapped might raise the windows over
    the popover's if its original position is unchanged.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=734129

 gtk/gtkwindow.c |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)
---
diff --git a/gtk/gtkwindow.c b/gtk/gtkwindow.c
index cf6b81a..e7b336b 100644
--- a/gtk/gtkwindow.c
+++ b/gtk/gtkwindow.c
@@ -11489,6 +11489,7 @@ _gtk_window_set_popover_position (GtkWindow                   *window,
                                   GtkPositionType              pos,
                                   const cairo_rectangle_int_t *rect)
 {
+  gboolean need_resize = TRUE;
   GtkWindowPopover *data;
 
   g_return_if_fail (GTK_IS_WINDOW (window));
@@ -11507,7 +11508,7 @@ _gtk_window_set_popover_position (GtkWindow                   *window,
     {
       if (data->pos == pos &&
           memcmp (&data->rect, rect, sizeof (cairo_rectangle_int_t)) == 0)
-        return;
+        need_resize = FALSE;
     }
 
   data->rect = *rect;
@@ -11524,7 +11525,8 @@ _gtk_window_set_popover_position (GtkWindow                   *window,
         gdk_window_raise (data->window);
     }
 
-  gtk_widget_queue_resize (popover);
+  if (need_resize)
+    gtk_widget_queue_resize (popover);
 }
 
 void


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