- const GtkAllocation& a1 = widget->allocation;
- const GtkAllocation& a2 = *alloc;
- GdkRectangle r1 = { a1.x, a1.y, a1.width, a1.height };
- GdkRectangle r2 = { a2.x, a2.y, a2.width, a2.height };
- gdk_window_invalidate_rect(widget->parent->window, &r1, false);
- gdk_window_invalidate_rect(widget->parent->window, &r2, false);
+ GdkWindow* parent = gtk_widget_get_parent_window(widget);
+ gdk_window_invalidate_rect(parent, &widget->allocation, false);
+ gdk_window_invalidate_rect(parent, alloc, false);