[gtk+/wip/baedert/drawing] menu: Popup at window coordinates if widget is given
- From: Timm Bäder <baedert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+/wip/baedert/drawing] menu: Popup at window coordinates if widget is given
- Date: Wed, 21 Jun 2017 19:28:57 +0000 (UTC)
commit 381b5f6654e22c7c403946cb76ee884c32d75ed2
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 e4fe1ba..472f5b7 100644
--- a/gtk/gtkwidget.c
+++ b/gtk/gtkwidget.c
@@ -4931,8 +4931,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]