diff options
author | Rob Bradford <rob@linux.intel.com> | 2013-02-26 19:33:04 +0000 |
---|---|---|
committer | Matthias Clasen <mclasen@redhat.com> | 2013-03-17 11:28:26 -0400 |
commit | 55a98da4d44117a34cc733c27120e114f7bd7260 (patch) | |
tree | 51126b0ae78b042191ac160ee6e2839d0578d014 /gtk/gtkapplicationwindow.c | |
parent | 026d47d909edb98a41039a5af3b1572c99cc7353 (diff) | |
download | gtk+-55a98da4d44117a34cc733c27120e114f7bd7260.tar.gz |
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.
Diffstat (limited to 'gtk/gtkapplicationwindow.c')
-rw-r--r-- | gtk/gtkapplicationwindow.c | 11 |
1 files changed, 7 insertions, 4 deletions
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)); |