Commit 4822ca0d authored by Michael Natterer's avatar Michael Natterer 😴

Make menu positioning also works for transformed offscreen widgets

(gimp_button_menu_position): reorder the code, use the new
gdk_window_get_root_coords() and pass it coordinates that include
the widget's offset within its parent gdk window.
parent 0ce426cc
......@@ -166,7 +166,16 @@ gimp_button_menu_position (GtkWidget *button,
gdk_window_get_origin (gtk_widget_get_window (button), x, y);
*x = 0;
*y = 0;
if (! gtk_widget_get_has_window (button))
*x += button->allocation.x;
*y += button->allocation.y;
gdk_window_get_root_coords (gtk_widget_get_window (button), *x, *y, x, y);
gtk_widget_size_request (GTK_WIDGET (menu), &menu_requisition);
......@@ -177,9 +186,6 @@ gimp_button_menu_position (GtkWidget *button,
gtk_menu_set_screen (menu, screen);
if (! gtk_widget_get_has_window (button))
*x += button->allocation.x;
switch (position)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment