diff options
author | Timm Bäder <mail@baedert.org> | 2017-06-21 21:31:08 +0200 |
---|---|---|
committer | Matthias Clasen <mclasen@redhat.com> | 2017-07-19 21:27:14 -0400 |
commit | bc4c32505ac2a6c87097a45c372bf1ad1454f865 (patch) | |
tree | 3ed4b6ed9906f8ffe20517c7d37055688bbbdd9a | |
parent | 8dd29d755c7446a1bc8af992c09d0cb61d1e8b0b (diff) | |
download | gtk+-bc4c32505ac2a6c87097a45c372bf1ad1454f865.tar.gz |
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.
-rw-r--r-- | gtk/gtkmenu.c | 2 | ||||
-rw-r--r-- | gtk/gtkwidget.c | 2 |
2 files changed, 1 insertions, 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)) |