[gtk+/wip/baedert/drawing: 67/102] menu: Popup at window coordinates if widget is given



commit ca81b7f68e62642e70df35f8302f0088c3ecaef8
Author: Timm Bäder <mail baedert org>
Date:   Wed Jun 21 21:31:08 2017 +0200

    menu: Popup at window coordinates if widget is given
    
    Since widget allocations are now relative to the parent's origin, we
    need to pass the window allocation here.

 gtk/gtkmenu.c   |    2 +-
 gtk/gtkwidget.c |    2 --
 2 files changed, 1 insertions(+), 3 deletions(-)
---
diff --git a/gtk/gtkmenu.c b/gtk/gtkmenu.c
index 1ac19c0..368fad7 100644
--- a/gtk/gtkmenu.c
+++ b/gtk/gtkmenu.c
@@ -4085,7 +4085,7 @@ gtk_menu_position (GtkMenu  *menu,
   else if (priv->widget)
     {
       rect_window = gtk_widget_get_window (priv->widget);
-      gtk_widget_get_allocation (priv->widget, &rect);
+      gtk_widget_get_window_allocation (priv->widget, &rect);
       text_direction = gtk_widget_get_direction (priv->widget);
     }
   else if (!priv->position_func)
diff --git a/gtk/gtkwidget.c b/gtk/gtkwidget.c
index 6a6024b..2736cab 100644
--- a/gtk/gtkwidget.c
+++ b/gtk/gtkwidget.c
@@ -4927,8 +4927,6 @@ gtk_widget_get_window_allocation (GtkWidget     *widget,
   GtkWidget *parent;
   GtkAllocation alloc;
 
-  g_assert (gtk_widget_get_has_window (widget));
-
   /* Don't consider the parent == widget case here. */
   parent = _gtk_widget_get_parent (widget);
   while (parent && !_gtk_widget_get_has_window (parent))


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