-inline WindowVector windowvector_for_widget_centre( GtkWidget* widget ){
- return WindowVector( static_cast<float>( widget->allocation.width / 2 ), static_cast<float>( widget->allocation.height / 2 ) );
+inline WindowVector windowvector_for_widget_centre( ui::Widget widget ){
+ GtkAllocation allocation;
+ gtk_widget_get_allocation(widget, &allocation);
+ return WindowVector( static_cast<float>( allocation.width / 2 ), static_cast<float>(allocation.height / 2 ) );