Commit d1bda8d5 authored by Owen Taylor's avatar Owen Taylor Committed by Owen Taylor

Fixed some bugs with set_default_size.

Sun Feb  7 19:49:21 1999  Owen Taylor  <otaylor@redhat.com>

	* gtk/gtkwindow.c (gtk_window_move_resize): Fixed some
	  bugs with set_default_size.

Sat Feb  6 13:23:51 1999  Owen Taylor  <otaylor@redhat.com>

	* docs/Changes-1.2.txt: Added information about
	 the change to gtk_widget_size_request().

	* gtk/gtkentry.c: Call gtk_widget_get_child_requisition
	 explicitely since we differentiate between the usize
	 set by the user and what we got. (Ugh)

	* gtk/gtkwidget.[ch] (gtk_widget_get_child_requisition):
	 New function to return the effective size of a widget
	 as it looks to its parent.

	* gtk/gtkwidget.c (gtk_widget_size_request): Leave
	 widget->requisition set to exactly what the widget
	 asked for, and then make a copy of that into
	 the requisition argument. Allow a NULL requisition
	 argument, and, if G_ENABLE_DEBUG, warn if
	 requisition == &widget->requisition.

	* gtkalignment.c gtkaspectframe.c gtkbutton.c gtkclist.c
	  gtkcontainer.c gtkentry.c gtkeventbox.c gtkfixed.c
	  gtkframe.c gtkhandlebox.c gtkhbox.c gtkhpaned.c
	  gtklayout.c gtklist.c gtklistitem.c gtkmenu.c
	  gtkmenubar.c gtkmenuitem.c gtknotebook.c
	  gtkoptionmenu.c gtkpacker.c gtkscrolledwindow.c
	  gtktable.c gtktoolbar.c gtktree.c gtktreeitem.c
	  gtkvbox.c gtkviewport.c gtkvpaned.c gtkwindow.c

	 Avoid calling gtk_widget_size_request with
	 requisition == widget->requisition; use
	 gtk_widget_get_child_requisition to get the
	 size of children.
parent 84d9f5f9
Sun Feb 7 19:49:21 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwindow.c (gtk_window_move_resize): Fixed some
bugs with set_default_size.
Sat Feb 6 13:23:51 1999 Owen Taylor <otaylor@redhat.com>
* docs/Changes-1.2.txt: Added information about
the change to gtk_widget_size_request().
* gtk/gtkentry.c: Call gtk_widget_get_child_requisition
explicitely since we differentiate between the usize
set by the user and what we got. (Ugh)
* gtk/gtkwidget.[ch] (gtk_widget_get_child_requisition):
New function to return the effective size of a widget
as it looks to its parent.
* gtk/gtkwidget.c (gtk_widget_size_request): Leave
widget->requisition set to exactly what the widget
asked for, and then make a copy of that into
the requisition argument. Allow a NULL requisition
argument, and, if G_ENABLE_DEBUG, warn if
requisition == &widget->requisition.
* gtkalignment.c gtkaspectframe.c gtkbutton.c gtkclist.c
gtkcontainer.c gtkentry.c gtkeventbox.c gtkfixed.c
gtkframe.c gtkhandlebox.c gtkhbox.c gtkhpaned.c
gtklayout.c gtklist.c gtklistitem.c gtkmenu.c
gtkmenubar.c gtkmenuitem.c gtknotebook.c
gtkoptionmenu.c gtkpacker.c gtkscrolledwindow.c
gtktable.c gtktoolbar.c gtktree.c gtktreeitem.c
gtkvbox.c gtkviewport.c gtkvpaned.c gtkwindow.c
Avoid calling gtk_widget_size_request with
requisition == widget->requisition; use
gtk_widget_get_child_requisition to get the
size of children.
Tue Feb 9 19:49:46 1999 Owen Taylor <otaylor@redhat.com>
* configure.in (LDFLAGS): Removed extraneous line
......@@ -59,6 +98,7 @@ Mon Feb 8 12:50:06 GMT 1999 Tony Gale <gale@gtk.org>
* Makefile.am: update to include the latest Tutorial examples.
>>>>>>> 1.1009
Sat Feb 6 11:20:16 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwidget.c (gtk_widget_idle_draw): Add the
......
Sun Feb 7 19:49:21 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwindow.c (gtk_window_move_resize): Fixed some
bugs with set_default_size.
Sat Feb 6 13:23:51 1999 Owen Taylor <otaylor@redhat.com>
* docs/Changes-1.2.txt: Added information about
the change to gtk_widget_size_request().
* gtk/gtkentry.c: Call gtk_widget_get_child_requisition
explicitely since we differentiate between the usize
set by the user and what we got. (Ugh)
* gtk/gtkwidget.[ch] (gtk_widget_get_child_requisition):
New function to return the effective size of a widget
as it looks to its parent.
* gtk/gtkwidget.c (gtk_widget_size_request): Leave
widget->requisition set to exactly what the widget
asked for, and then make a copy of that into
the requisition argument. Allow a NULL requisition
argument, and, if G_ENABLE_DEBUG, warn if
requisition == &widget->requisition.
* gtkalignment.c gtkaspectframe.c gtkbutton.c gtkclist.c
gtkcontainer.c gtkentry.c gtkeventbox.c gtkfixed.c
gtkframe.c gtkhandlebox.c gtkhbox.c gtkhpaned.c
gtklayout.c gtklist.c gtklistitem.c gtkmenu.c
gtkmenubar.c gtkmenuitem.c gtknotebook.c
gtkoptionmenu.c gtkpacker.c gtkscrolledwindow.c
gtktable.c gtktoolbar.c gtktree.c gtktreeitem.c
gtkvbox.c gtkviewport.c gtkvpaned.c gtkwindow.c
Avoid calling gtk_widget_size_request with
requisition == widget->requisition; use
gtk_widget_get_child_requisition to get the
size of children.
Tue Feb 9 19:49:46 1999 Owen Taylor <otaylor@redhat.com>
* configure.in (LDFLAGS): Removed extraneous line
......@@ -59,6 +98,7 @@ Mon Feb 8 12:50:06 GMT 1999 Tony Gale <gale@gtk.org>
* Makefile.am: update to include the latest Tutorial examples.
>>>>>>> 1.1009
Sat Feb 6 11:20:16 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwidget.c (gtk_widget_idle_draw): Add the
......
Sun Feb 7 19:49:21 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwindow.c (gtk_window_move_resize): Fixed some
bugs with set_default_size.
Sat Feb 6 13:23:51 1999 Owen Taylor <otaylor@redhat.com>
* docs/Changes-1.2.txt: Added information about
the change to gtk_widget_size_request().
* gtk/gtkentry.c: Call gtk_widget_get_child_requisition
explicitely since we differentiate between the usize
set by the user and what we got. (Ugh)
* gtk/gtkwidget.[ch] (gtk_widget_get_child_requisition):
New function to return the effective size of a widget
as it looks to its parent.
* gtk/gtkwidget.c (gtk_widget_size_request): Leave
widget->requisition set to exactly what the widget
asked for, and then make a copy of that into
the requisition argument. Allow a NULL requisition
argument, and, if G_ENABLE_DEBUG, warn if
requisition == &widget->requisition.
* gtkalignment.c gtkaspectframe.c gtkbutton.c gtkclist.c
gtkcontainer.c gtkentry.c gtkeventbox.c gtkfixed.c
gtkframe.c gtkhandlebox.c gtkhbox.c gtkhpaned.c
gtklayout.c gtklist.c gtklistitem.c gtkmenu.c
gtkmenubar.c gtkmenuitem.c gtknotebook.c
gtkoptionmenu.c gtkpacker.c gtkscrolledwindow.c
gtktable.c gtktoolbar.c gtktree.c gtktreeitem.c
gtkvbox.c gtkviewport.c gtkvpaned.c gtkwindow.c
Avoid calling gtk_widget_size_request with
requisition == widget->requisition; use
gtk_widget_get_child_requisition to get the
size of children.
Tue Feb 9 19:49:46 1999 Owen Taylor <otaylor@redhat.com>
* configure.in (LDFLAGS): Removed extraneous line
......@@ -59,6 +98,7 @@ Mon Feb 8 12:50:06 GMT 1999 Tony Gale <gale@gtk.org>
* Makefile.am: update to include the latest Tutorial examples.
>>>>>>> 1.1009
Sat Feb 6 11:20:16 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwidget.c (gtk_widget_idle_draw): Add the
......
Sun Feb 7 19:49:21 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwindow.c (gtk_window_move_resize): Fixed some
bugs with set_default_size.
Sat Feb 6 13:23:51 1999 Owen Taylor <otaylor@redhat.com>
* docs/Changes-1.2.txt: Added information about
the change to gtk_widget_size_request().
* gtk/gtkentry.c: Call gtk_widget_get_child_requisition
explicitely since we differentiate between the usize
set by the user and what we got. (Ugh)
* gtk/gtkwidget.[ch] (gtk_widget_get_child_requisition):
New function to return the effective size of a widget
as it looks to its parent.
* gtk/gtkwidget.c (gtk_widget_size_request): Leave
widget->requisition set to exactly what the widget
asked for, and then make a copy of that into
the requisition argument. Allow a NULL requisition
argument, and, if G_ENABLE_DEBUG, warn if
requisition == &widget->requisition.
* gtkalignment.c gtkaspectframe.c gtkbutton.c gtkclist.c
gtkcontainer.c gtkentry.c gtkeventbox.c gtkfixed.c
gtkframe.c gtkhandlebox.c gtkhbox.c gtkhpaned.c
gtklayout.c gtklist.c gtklistitem.c gtkmenu.c
gtkmenubar.c gtkmenuitem.c gtknotebook.c
gtkoptionmenu.c gtkpacker.c gtkscrolledwindow.c
gtktable.c gtktoolbar.c gtktree.c gtktreeitem.c
gtkvbox.c gtkviewport.c gtkvpaned.c gtkwindow.c
Avoid calling gtk_widget_size_request with
requisition == widget->requisition; use
gtk_widget_get_child_requisition to get the
size of children.
Tue Feb 9 19:49:46 1999 Owen Taylor <otaylor@redhat.com>
* configure.in (LDFLAGS): Removed extraneous line
......@@ -59,6 +98,7 @@ Mon Feb 8 12:50:06 GMT 1999 Tony Gale <gale@gtk.org>
* Makefile.am: update to include the latest Tutorial examples.
>>>>>>> 1.1009
Sat Feb 6 11:20:16 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwidget.c (gtk_widget_idle_draw): Add the
......
Sun Feb 7 19:49:21 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwindow.c (gtk_window_move_resize): Fixed some
bugs with set_default_size.
Sat Feb 6 13:23:51 1999 Owen Taylor <otaylor@redhat.com>
* docs/Changes-1.2.txt: Added information about
the change to gtk_widget_size_request().
* gtk/gtkentry.c: Call gtk_widget_get_child_requisition
explicitely since we differentiate between the usize
set by the user and what we got. (Ugh)
* gtk/gtkwidget.[ch] (gtk_widget_get_child_requisition):
New function to return the effective size of a widget
as it looks to its parent.
* gtk/gtkwidget.c (gtk_widget_size_request): Leave
widget->requisition set to exactly what the widget
asked for, and then make a copy of that into
the requisition argument. Allow a NULL requisition
argument, and, if G_ENABLE_DEBUG, warn if
requisition == &widget->requisition.
* gtkalignment.c gtkaspectframe.c gtkbutton.c gtkclist.c
gtkcontainer.c gtkentry.c gtkeventbox.c gtkfixed.c
gtkframe.c gtkhandlebox.c gtkhbox.c gtkhpaned.c
gtklayout.c gtklist.c gtklistitem.c gtkmenu.c
gtkmenubar.c gtkmenuitem.c gtknotebook.c
gtkoptionmenu.c gtkpacker.c gtkscrolledwindow.c
gtktable.c gtktoolbar.c gtktree.c gtktreeitem.c
gtkvbox.c gtkviewport.c gtkvpaned.c gtkwindow.c
Avoid calling gtk_widget_size_request with
requisition == widget->requisition; use
gtk_widget_get_child_requisition to get the
size of children.
Tue Feb 9 19:49:46 1999 Owen Taylor <otaylor@redhat.com>
* configure.in (LDFLAGS): Removed extraneous line
......@@ -59,6 +98,7 @@ Mon Feb 8 12:50:06 GMT 1999 Tony Gale <gale@gtk.org>
* Makefile.am: update to include the latest Tutorial examples.
>>>>>>> 1.1009
Sat Feb 6 11:20:16 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwidget.c (gtk_widget_idle_draw): Add the
......
Sun Feb 7 19:49:21 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwindow.c (gtk_window_move_resize): Fixed some
bugs with set_default_size.
Sat Feb 6 13:23:51 1999 Owen Taylor <otaylor@redhat.com>
* docs/Changes-1.2.txt: Added information about
the change to gtk_widget_size_request().
* gtk/gtkentry.c: Call gtk_widget_get_child_requisition
explicitely since we differentiate between the usize
set by the user and what we got. (Ugh)
* gtk/gtkwidget.[ch] (gtk_widget_get_child_requisition):
New function to return the effective size of a widget
as it looks to its parent.
* gtk/gtkwidget.c (gtk_widget_size_request): Leave
widget->requisition set to exactly what the widget
asked for, and then make a copy of that into
the requisition argument. Allow a NULL requisition
argument, and, if G_ENABLE_DEBUG, warn if
requisition == &widget->requisition.
* gtkalignment.c gtkaspectframe.c gtkbutton.c gtkclist.c
gtkcontainer.c gtkentry.c gtkeventbox.c gtkfixed.c
gtkframe.c gtkhandlebox.c gtkhbox.c gtkhpaned.c
gtklayout.c gtklist.c gtklistitem.c gtkmenu.c
gtkmenubar.c gtkmenuitem.c gtknotebook.c
gtkoptionmenu.c gtkpacker.c gtkscrolledwindow.c
gtktable.c gtktoolbar.c gtktree.c gtktreeitem.c
gtkvbox.c gtkviewport.c gtkvpaned.c gtkwindow.c
Avoid calling gtk_widget_size_request with
requisition == widget->requisition; use
gtk_widget_get_child_requisition to get the
size of children.
Tue Feb 9 19:49:46 1999 Owen Taylor <otaylor@redhat.com>
* configure.in (LDFLAGS): Removed extraneous line
......@@ -59,6 +98,7 @@ Mon Feb 8 12:50:06 GMT 1999 Tony Gale <gale@gtk.org>
* Makefile.am: update to include the latest Tutorial examples.
>>>>>>> 1.1009
Sat Feb 6 11:20:16 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwidget.c (gtk_widget_idle_draw): Add the
......
Sun Feb 7 19:49:21 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwindow.c (gtk_window_move_resize): Fixed some
bugs with set_default_size.
Sat Feb 6 13:23:51 1999 Owen Taylor <otaylor@redhat.com>
* docs/Changes-1.2.txt: Added information about
the change to gtk_widget_size_request().
* gtk/gtkentry.c: Call gtk_widget_get_child_requisition
explicitely since we differentiate between the usize
set by the user and what we got. (Ugh)
* gtk/gtkwidget.[ch] (gtk_widget_get_child_requisition):
New function to return the effective size of a widget
as it looks to its parent.
* gtk/gtkwidget.c (gtk_widget_size_request): Leave
widget->requisition set to exactly what the widget
asked for, and then make a copy of that into
the requisition argument. Allow a NULL requisition
argument, and, if G_ENABLE_DEBUG, warn if
requisition == &widget->requisition.
* gtkalignment.c gtkaspectframe.c gtkbutton.c gtkclist.c
gtkcontainer.c gtkentry.c gtkeventbox.c gtkfixed.c
gtkframe.c gtkhandlebox.c gtkhbox.c gtkhpaned.c
gtklayout.c gtklist.c gtklistitem.c gtkmenu.c
gtkmenubar.c gtkmenuitem.c gtknotebook.c
gtkoptionmenu.c gtkpacker.c gtkscrolledwindow.c
gtktable.c gtktoolbar.c gtktree.c gtktreeitem.c
gtkvbox.c gtkviewport.c gtkvpaned.c gtkwindow.c
Avoid calling gtk_widget_size_request with
requisition == widget->requisition; use
gtk_widget_get_child_requisition to get the
size of children.
Tue Feb 9 19:49:46 1999 Owen Taylor <otaylor@redhat.com>
* configure.in (LDFLAGS): Removed extraneous line
......@@ -59,6 +98,7 @@ Mon Feb 8 12:50:06 GMT 1999 Tony Gale <gale@gtk.org>
* Makefile.am: update to include the latest Tutorial examples.
>>>>>>> 1.1009
Sat Feb 6 11:20:16 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwidget.c (gtk_widget_idle_draw): Add the
......
......@@ -245,3 +245,30 @@ Incompatible Changes from GTK+-1.0 to GTK+-1.2:
You can get these CFLAGS and LIBS by passing gthread
as the fourth parameter to the AM_PATH_GTK automake
macro.
* Prior to GTK+-1.2, there were two conflicting interpretations
of widget->requistion. It was either taken to be
the size that the widget requested, or that size
modified by calls to gtk_widget_set_usize(). In GTK+-1.2,
it is always interpreted the first way.
Container widgets are affected in two ways by this:
1) Container widgets should not pass widget->requisition
as the second parameter to gtk_widget_size_request().
Instead they should call it like:
GtkRequisition child_requisition;
gtk_widget_size_request (widget, &child_requisition);
2) Container widgets should not access child->requisition
directly. Either they should use the values returned
by gtk_widget_size_request(), or they should call
the new function:
void gtk_widget_get_child_requisition (GtkWidget *widget,
GtkRequisition *requisition);
which returns the requisition of the given widget, modified
by calls to gtk_widget_set_usize().
......@@ -241,10 +241,12 @@ gtk_alignment_size_request (GtkWidget *widget,
if (bin->child && GTK_WIDGET_VISIBLE (bin->child))
{
gtk_widget_size_request (bin->child, &bin->child->requisition);
GtkRequisition child_requisition;
gtk_widget_size_request (bin->child, &child_requisition);
requisition->width += bin->child->requisition.width;
requisition->height += bin->child->requisition.height;
requisition->width += child_requisition.width;
requisition->height += child_requisition.height;
}
}
......@@ -255,6 +257,7 @@ gtk_alignment_size_allocate (GtkWidget *widget,
GtkAlignment *alignment;
GtkBin *bin;
GtkAllocation child_allocation;
GtkRequisition child_requisition;
gint width, height;
gint x, y;
......@@ -268,20 +271,22 @@ gtk_alignment_size_allocate (GtkWidget *widget,
if (bin->child && GTK_WIDGET_VISIBLE (bin->child))
{
gtk_widget_get_child_requisition (bin->child, &child_requisition);
x = GTK_CONTAINER (alignment)->border_width;
y = GTK_CONTAINER (alignment)->border_width;
width = MAX (allocation->width - 2 * x, 0);
height = MAX (allocation->height - 2 * y, 0);
if (width > bin->child->requisition.width)
child_allocation.width = (bin->child->requisition.width *
if (width > child_requisition.width)
child_allocation.width = (child_requisition.width *
(1.0 - alignment->xscale) +
width * alignment->xscale);
else
child_allocation.width = width;
if (height > bin->child->requisition.height)
child_allocation.height = (bin->child->requisition.height *
if (height > child_requisition.height)
child_allocation.height = (child_requisition.height *
(1.0 - alignment->yscale) +
height * alignment->yscale);
else
......
......@@ -295,13 +295,16 @@ gtk_aspect_frame_size_allocate (GtkWidget *widget,
{
if (aspect_frame->obey_child)
{
if (bin->child->requisition.height != 0)
GtkRequisition child_requisition;
gtk_widget_get_child_requisition (bin->child, &child_requisition);
if (child_requisition.height != 0)
{
ratio = (gdouble)bin->child->requisition.width /
bin->child->requisition.height;
ratio = (gdouble)child_requisition.width /
child_requisition.height;
if (ratio < MIN_RATIO) ratio = MIN_RATIO;
}
else if (bin->child->requisition.width != 0)
else if (child_requisition.width != 0)
ratio = MAX_RATIO;
else
ratio = 1.0;
......
......@@ -435,10 +435,12 @@ gtk_button_size_request (GtkWidget *widget,
if (GTK_BIN (button)->child && GTK_WIDGET_VISIBLE (GTK_BIN (button)->child))
{
gtk_widget_size_request (GTK_BIN (button)->child, &GTK_BIN (button)->child->requisition);
GtkRequisition child_requisition;
requisition->width += GTK_BIN (button)->child->requisition.width;
requisition->height += GTK_BIN (button)->child->requisition.height;
gtk_widget_size_request (GTK_BIN (button)->child, &child_requisition);
requisition->width += child_requisition.width;
requisition->height += child_requisition.height;
}
}
......
......@@ -5393,11 +5393,13 @@ gtk_clist_size_request (GtkWidget *widget,
for (i = 0; i < clist->columns; i++)
if (clist->column[i].button)
{
GtkRequisition child_requisition;
gtk_widget_size_request (clist->column[i].button,
&clist->column[i].button->requisition);
&child_requisition);
clist->column_title_area.height =
MAX (clist->column_title_area.height,
clist->column[i].button->requisition.height);
child_requisition.height);
}
requisition->width += (widget->style->klass->xthickness +
......@@ -6088,14 +6090,15 @@ adjust_adjustments (GtkCList *clist,
if (!block_resize && (!clist->vadjustment || !clist->hadjustment))
{
GtkWidget *widget;
GtkRequisition requisition;
widget = GTK_WIDGET (clist);
gtk_widget_size_request (widget, &widget->requisition);
gtk_widget_size_request (widget, &requisition);
if ((!clist->hadjustment &&
widget->requisition.width != widget->allocation.width) ||
requisition.width != widget->allocation.width) ||
(!clist->vadjustment &&
widget->requisition.height != widget->allocation.height))
requisition.height != widget->allocation.height))
gtk_widget_queue_resize (widget);
}
}
......
......@@ -897,16 +897,17 @@ static void
gtk_container_real_check_resize (GtkContainer *container)
{
GtkWidget *widget;
GtkRequisition requisition;
g_return_if_fail (container != NULL);
g_return_if_fail (GTK_IS_CONTAINER (container));
widget = GTK_WIDGET (container);
gtk_widget_size_request (widget, &widget->requisition);
gtk_widget_size_request (widget, &requisition);
if (widget->requisition.width > widget->allocation.width ||
widget->requisition.height > widget->allocation.height)
if (requisition.width > widget->allocation.width ||
requisition.height > widget->allocation.height)
{
if (GTK_IS_RESIZE_CONTAINER (container))
gtk_widget_size_allocate (GTK_WIDGET (container),
......
......@@ -539,6 +539,7 @@ gtk_entry_realize (GtkWidget *widget)
{
GtkEntry *entry;
GtkEditable *editable;
GtkRequisition requisition;
GdkWindowAttr attributes;
gint attributes_mask;
......@@ -548,13 +549,15 @@ gtk_entry_realize (GtkWidget *widget)
GTK_WIDGET_SET_FLAGS (widget, GTK_REALIZED);
entry = GTK_ENTRY (widget);
editable = GTK_EDITABLE (widget);
gtk_widget_get_child_requisition (widget, &requisition);
attributes.window_type = GDK_WINDOW_CHILD;
attributes.x = widget->allocation.x;
attributes.y = widget->allocation.y + (widget->allocation.height -
widget->requisition.height) / 2;
requisition.height) / 2;
attributes.width = widget->allocation.width;
attributes.height = widget->requisition.height;
attributes.height = requisition.height;
attributes.wclass = GDK_INPUT_OUTPUT;
attributes.visual = gtk_widget_get_visual (widget);
attributes.colormap = gtk_widget_get_colormap (widget);
......@@ -576,7 +579,7 @@ gtk_entry_realize (GtkWidget *widget)
attributes.x = widget->style->klass->xthickness;
attributes.y = widget->style->klass->ythickness;
attributes.width = widget->allocation.width - attributes.x * 2;
attributes.height = widget->requisition.height - attributes.y * 2;
attributes.height = requisition.height - attributes.y * 2;
attributes.cursor = entry->cursor = gdk_cursor_new (GDK_XTERM);
attributes_mask |= GDK_WA_CURSOR;
......@@ -774,15 +777,22 @@ gtk_entry_size_allocate (GtkWidget *widget,
if (GTK_WIDGET_REALIZED (widget))
{
/* We call gtk_widget_get_child_requisition, since we want (for
* backwards compatibility reasons) the realization here to
* be affected by the usize of the entry, if set
*/
GtkRequisition requisition;
gtk_widget_get_child_requisition (widget, &requisition);
gdk_window_move_resize (widget->window,
allocation->x,
allocation->y + (allocation->height - widget->requisition.height) / 2,
allocation->width, widget->requisition.height);
allocation->y + (allocation->height - requisition.height) / 2,
allocation->width, requisition.height);
gdk_window_move_resize (entry->text_area,
widget->style->klass->xthickness,
widget->style->klass->ythickness,
allocation->width - widget->style->klass->xthickness * 2,
widget->requisition.height - widget->style->klass->ythickness * 2);
requisition.height - widget->style->klass->ythickness * 2);
/* And make sure the cursor is on screen */
entry_adjust_scroll (entry);
......
......@@ -142,10 +142,12 @@ gtk_event_box_size_request (GtkWidget *widget,
if (bin->child && GTK_WIDGET_VISIBLE (bin->child))
{
gtk_widget_size_request (bin->child, &bin->child->requisition);
GtkRequisition child_requisition;
gtk_widget_size_request (bin->child, &child_requisition);
requisition->width += bin->child->requisition.width;
requisition->height += bin->child->requisition.height;
requisition->width += child_requisition.width;
requisition->height += child_requisition.height;
}
}
......
......@@ -250,6 +250,7 @@ gtk_fixed_size_request (GtkWidget *widget,
GtkFixed *fixed;
GtkFixedChild *child;
GList *children;
GtkRequisition child_requisition;
g_return_if_fail (widget != NULL);
g_return_if_fail (GTK_IS_FIXED (widget));
......@@ -267,14 +268,14 @@ gtk_fixed_size_request (GtkWidget *widget,
if (GTK_WIDGET_VISIBLE (child->widget))
{
gtk_widget_size_request (child->widget, &child->widget->requisition);
gtk_widget_size_request (child->widget, &child_requisition);
requisition->height = MAX (requisition->height,
child->y +
child->widget->requisition.height);
child_requisition.height);
requisition->width = MAX (requisition->width,
child->x +
child->widget->requisition.width);
child_requisition.width);
}
}
......@@ -289,6 +290,7 @@ gtk_fixed_size_allocate (GtkWidget *widget,
GtkFixed *fixed;
GtkFixedChild *child;
GtkAllocation child_allocation;
GtkRequisition child_requisition;
GList *children;
guint16 border_width;
......@@ -316,10 +318,11 @@ gtk_fixed_size_allocate (GtkWidget *widget,
if (GTK_WIDGET_VISIBLE (child->widget))
{
gtk_widget_get_child_requisition (child->widget, &child_requisition);
child_allocation.x = child->x + border_width;
child_allocation.y = child->y + border_width;
child_allocation.width = child->widget->requisition.width;
child_allocation.height = child->widget->requisition.height;
child_allocation.width = child_requisition.width;
child_allocation.height = child_requisition.height;
gtk_widget_size_allocate (child->widget, &child_allocation);
}
}
......
......@@ -456,10 +456,12 @@ gtk_frame_size_request (GtkWidget *widget,
if (bin->child && GTK_WIDGET_VISIBLE (bin->child))
{
gtk_widget_size_request (bin->child, &bin->child->requisition);
GtkRequisition child_requisition;
gtk_widget_size_request (bin->child, &child_requisition);
requisition->width += MAX (bin->child->requisition.width, frame->label_width);
requisition->height += bin->child->requisition.height;
requisition->width += MAX (child_requisition.width, frame->label_width);
requisition->height += child_requisition.height;
}
else
{
......
......@@ -415,6 +415,7 @@ gtk_handle_box_size_request (GtkWidget *widget,
{
GtkBin *bin;
GtkHandleBox *hb;
GtkRequisition child_requisition;
g_return_if_fail (widget != NULL);
g_return_if_fail (GTK_IS_HANDLE_BOX (widget));
......@@ -439,7 +440,7 @@ gtk_handle_box_size_request (GtkWidget *widget,
* won't have any usefull hint for our size otherwise.
*/
if (bin->child)
gtk_widget_size_request (bin->child, &bin->child->requisition);
gtk_widget_size_request (bin->child, &child_requisition);
if (hb->child_detached)
{
......@@ -447,9 +448,9 @@ gtk_handle_box_size_request (GtkWidget *widget,
{
if (hb->handle_position == GTK_POS_LEFT ||
hb->handle_position == GTK_POS_RIGHT)
requisition->height += bin->child->requisition.height;
requisition->height += child_requisition.height;
else
requisition->width += bin->child->requisition.width;
requisition->width += child_requisition.width;
}
else
{
......@@ -467,8 +468,8 @@ gtk_handle_box_size_request (GtkWidget *widget,
if (bin->child)
{
requisition->width += bin->child->requisition.width;
requisition->height += bin->