From bc4c32505ac2a6c87097a45c372bf1ad1454f865 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timm=20B=C3=A4der?= Date: Wed, 21 Jun 2017 21:31:08 +0200 Subject: 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 insertion(+), 3 deletions(-) diff --git a/gtk/gtkmenu.c b/gtk/gtkmenu.c index 1ac19c030c..368fad71ac 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 55849fb28c..76054b4767 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)) -- cgit v1.2.1