forked from AuroraMiddleware/gtk
gtkwindow: fix first allocation size
67ab00e01e
removed the fake configure code in gtk_window_show() and
replaced it with a simple gtk_widget_realize(). The initial allocation
code in realize() only allocates the natural size or the last requested
size which now no longer is set, resulting in a too small first allocation.
This builds a configure request to compute the allocation size instead
which includes default size, CSD etc..
This problem could be seen in case of a GtkPaned in a GtkWindow with a
default size set and the pane position set as well. The first allocation
would be the natural size of the GtkPaned which would clamp the pane
position if too larg. Only the second allocation would fill the parent
window using the now wrong pane position.
https://bugzilla.gnome.org/show_bug.cgi?id=759705
This commit is contained in:
parent
e93d64e4c3
commit
6d77b9f316
@ -7137,15 +7137,15 @@ gtk_window_realize (GtkWidget *widget)
|
|||||||
allocation.width == 1 &&
|
allocation.width == 1 &&
|
||||||
allocation.height == 1)
|
allocation.height == 1)
|
||||||
{
|
{
|
||||||
gint w, h;
|
GdkRectangle request;
|
||||||
|
gint default_width, default_height;
|
||||||
|
|
||||||
|
gtk_window_compute_configure_request (window, &request, NULL, NULL);
|
||||||
|
|
||||||
allocation.x = 0;
|
allocation.x = 0;
|
||||||
allocation.y = 0;
|
allocation.y = 0;
|
||||||
|
allocation.width = request.width;
|
||||||
gtk_window_guess_default_size (window, &allocation.width, &allocation.height);
|
allocation.height = request.height;
|
||||||
gtk_window_get_remembered_size (window, &w, &h);
|
|
||||||
allocation.width = MAX (allocation.width, w);
|
|
||||||
allocation.height = MAX (allocation.height, h);
|
|
||||||
gtk_widget_size_allocate (widget, &allocation);
|
gtk_widget_size_allocate (widget, &allocation);
|
||||||
|
|
||||||
gtk_widget_queue_resize (widget);
|
gtk_widget_queue_resize (widget);
|
||||||
|
Loading…
Reference in New Issue
Block a user