summaryrefslogtreecommitdiff
path: root/gtk/gtkwindow.c
diff options
context:
space:
mode:
authorTimm Bäder <mail@baedert.org>2018-01-12 22:22:51 +0100
committerTimm Bäder <mail@baedert.org>2018-01-12 22:34:22 +0100
commitc910a955d17a1fe3442a64105f40fb7faff360d3 (patch)
tree5fc358d702b12334e56d00922e6b8c6547917287 /gtk/gtkwindow.c
parent846a6e8157555c2469f16878e9dcd114a8c0b638 (diff)
downloadgtk+-c910a955d17a1fe3442a64105f40fb7faff360d3.tar.gz
window: Fix tooltip allocation
Using get_preferred_size here does not work since it computes the minimum height for the minimum width, but we want to know the minimum height for the current width.
Diffstat (limited to 'gtk/gtkwindow.c')
-rw-r--r--gtk/gtkwindow.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/gtk/gtkwindow.c b/gtk/gtkwindow.c
index 910264e139..99d58914ea 100644
--- a/gtk/gtkwindow.c
+++ b/gtk/gtkwindow.c
@@ -8976,7 +8976,7 @@ gtk_window_move_resize (GtkWindow *window)
else
{
GtkAllocation allocation, clip;
- GtkRequisition minsize;
+ int min_width, min_height;
/* Handle any position changes.
*/
@@ -8986,15 +8986,18 @@ gtk_window_move_resize (GtkWindow *window)
new_request.x, new_request.y);
}
- gtk_widget_get_preferred_size (widget, &minsize, NULL);
+ gtk_widget_measure (widget, GTK_ORIENTATION_HORIZONTAL, current_height,
+ &min_width, NULL, NULL, NULL);
+ gtk_widget_measure (widget, GTK_ORIENTATION_VERTICAL, current_width,
+ &min_height, NULL, NULL, NULL);
/* Our configure request didn't change size, but maybe some of
* our child widgets have. Run a size allocate with our current
* size to make sure that we re-layout our child widgets. */
allocation.x = 0;
allocation.y = 0;
- allocation.width = MAX (current_width, minsize.width);
- allocation.height = MAX (current_height, minsize.height);
+ allocation.width = MAX (current_width, min_width);
+ allocation.height = MAX (current_height, min_height);
gtk_widget_size_allocate (widget, &allocation, -1, &clip);
}