From 55a98da4d44117a34cc733c27120e114f7bd7260 Mon Sep 17 00:00:00 2001 From: Rob Bradford Date: Tue, 26 Feb 2013 19:33:04 +0000 Subject: window: Allow _gtk_window_set_allocation to return a modified allocation Update the documentation and users of this function to handle the future case that that we have some internal decorations to the window and useable allocation is thus smaller. By having a separate out parameter there is no need to have an in/out function and allows for greater robustness. The current implementation simply returns the allocation provided. --- gtk/gtkapplicationwindow.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'gtk/gtkapplicationwindow.c') diff --git a/gtk/gtkapplicationwindow.c b/gtk/gtkapplicationwindow.c index 271054b109..541baf6a03 100644 --- a/gtk/gtkapplicationwindow.c +++ b/gtk/gtkapplicationwindow.c @@ -703,13 +703,17 @@ gtk_application_window_real_size_allocate (GtkWidget *widget, if (window->priv->menubar != NULL) { - GtkAllocation menubar_allocation = *allocation; + GtkAllocation menubar_allocation; + GtkAllocation child_allocation; gint menubar_height; GtkWidget *child; - _gtk_window_set_allocation (GTK_WINDOW (widget), allocation); + _gtk_window_set_allocation (GTK_WINDOW (widget), allocation, &child_allocation); + menubar_allocation = child_allocation; - gtk_widget_get_preferred_height_for_width (window->priv->menubar, allocation->width, &menubar_height, NULL); + gtk_widget_get_preferred_height_for_width (window->priv->menubar, + menubar_allocation.width, + &menubar_height, NULL); menubar_allocation.height = menubar_height; gtk_widget_size_allocate (window->priv->menubar, &menubar_allocation); @@ -717,7 +721,6 @@ gtk_application_window_real_size_allocate (GtkWidget *widget, child = gtk_bin_get_child (GTK_BIN (window)); if (child != NULL && gtk_widget_get_visible (child)) { - GtkAllocation child_allocation = *allocation; gint border_width; border_width = gtk_container_get_border_width (GTK_CONTAINER (window)); -- cgit v1.2.1