Make gtk_container_propagate_draw work with frame window

gtk_container_propagate_draw was not working correctly in this
situation, since it was assuming that the child window is a
descendent of gtk_widget_get_window (container). As a consequence,
we were first adding the toplevel position to the offset, and
then resetting the offset to zero, both of which are not correct.
To fix this, exit the loop when we are hitting a toplevel window.
This commit is contained in:
Matthias Clasen
2013-07-05 21:30:04 -04:00
parent 00fd102417
commit 91df973558

View File

@@ -3478,6 +3478,11 @@ gtk_container_propagate_draw (GtkContainer *container,
for (w = gtk_widget_get_window (child); w && w != window; w = gdk_window_get_parent (w))
{
int wx, wy;
if (gdk_window_get_window_type (w) == GDK_WINDOW_TOPLEVEL ||
gdk_window_get_window_type (w) == GDK_WINDOW_TEMP)
break;
gdk_window_get_position (w, &wx, &wy);
x += wx;
y += wy;