Commit 9e81022b authored by Javier Jardón's avatar Javier Jardón

Use gtk_size_request_get_size() instead deprecated gtk_widget_get_child_requisition()

Fixes https://bugzilla.gnome.org/show_bug.cgi?id=629177
parent 153bfacd
......@@ -44,7 +44,11 @@
*/
#include "config.h"
#include "gtkaspectframe.h"
#include "gtksizerequest.h"
#include "gtkprivate.h"
#include "gtkintl.h"
......@@ -348,7 +352,8 @@ gtk_aspect_frame_compute_child_allocation (GtkFrame *frame,
{
GtkRequisition child_requisition;
gtk_widget_get_child_requisition (child, &child_requisition);
gtk_size_request_get_size (GTK_SIZE_REQUEST (child),
&child_requisition, NULL);
if (child_requisition.height != 0)
{
ratio = ((gdouble) child_requisition.width /
......
......@@ -58,6 +58,7 @@
#include "gtkimage.h"
#include "gtklabel.h"
#include "gtksizegroup.h"
#include "gtksizerequest.h"
#include "gtkstock.h"
#include "gtkintl.h"
......@@ -1224,7 +1225,8 @@ gtk_assistant_size_allocate (GtkWidget *widget,
border_width = gtk_container_get_border_width (GTK_CONTAINER (widget));
/* Header */
gtk_widget_get_child_requisition (priv->header_image, &header_requisition);
gtk_size_request_get_size (GTK_SIZE_REQUEST (priv->header_image),
&header_requisition, NULL);
header_allocation.x = border_width + header_padding;
header_allocation.y = border_width + header_padding;
......@@ -1234,7 +1236,8 @@ gtk_assistant_size_allocate (GtkWidget *widget,
gtk_widget_size_allocate (priv->header_image, &header_allocation);
/* Action area */
gtk_widget_get_child_requisition (priv->action_area, &action_requisition);
gtk_size_request_get_size (GTK_SIZE_REQUEST (priv->action_area),
&action_requisition, NULL);
child_allocation.x = border_width;
child_allocation.y = allocation->height - border_width - action_requisition.height;
......@@ -1247,7 +1250,8 @@ gtk_assistant_size_allocate (GtkWidget *widget,
gtk_widget_get_allocation (priv->action_area, &action_area_allocation);
/* Sidebar */
gtk_widget_get_child_requisition (priv->sidebar_image, &sidebar_requisition);
gtk_size_request_get_size (GTK_SIZE_REQUEST (priv->sidebar_image),
&sidebar_requisition, NULL);
if (rtl)
child_allocation.x = allocation->width - border_width - sidebar_requisition.width;
......
......@@ -45,9 +45,13 @@
*/
#include "config.h"
#include "gtkbbox.h"
#include "gtkorientable.h"
#include "gtkprivate.h"
#include "gtksizerequest.h"
#include "gtkintl.h"
......@@ -474,7 +478,8 @@ gtk_button_box_child_requisition (GtkWidget *widget,
if (is_secondary)
nsecondaries++;
gtk_widget_get_child_requisition (child, &child_requisition);
gtk_size_request_get_size (GTK_SIZE_REQUEST (child),
&child_requisition, NULL);
if (homogeneous || (child_requisition.width + ipad_w < avg_w * 1.5))
{
......
......@@ -25,8 +25,12 @@
*/
#include "config.h"
#include "gtkcheckbutton.h"
#include "gtklabel.h"
#include "gtksizerequest.h"
#include "gtkprivate.h"
#include "gtkintl.h"
......@@ -290,8 +294,9 @@ gtk_check_button_size_allocate (GtkWidget *widget,
GtkRequisition child_requisition;
guint border_width = gtk_container_get_border_width (GTK_CONTAINER (widget));
gtk_widget_get_child_requisition (child, &child_requisition);
gtk_size_request_get_size (GTK_SIZE_REQUEST (child),
&child_requisition, NULL);
child_allocation.width = MIN (child_requisition.width,
allocation->width -
((border_width + focus_width + focus_pad) * 2
......
......@@ -53,6 +53,7 @@
#include "gtkseparatormenuitem.h"
#include "gtkselection.h"
#include "gtksettings.h"
#include "gtksizerequest.h"
#include "gtkspinbutton.h"
#include "gtkstock.h"
#include "gtktextutil.h"
......@@ -2990,7 +2991,8 @@ gtk_entry_get_text_area_size (GtkEntry *entry,
gint frame_height;
gint xborder, yborder;
gtk_widget_get_child_requisition (widget, &requisition);
gtk_size_request_get_size (GTK_SIZE_REQUEST (widget),
&requisition, NULL);
gtk_widget_get_allocation (widget, &allocation);
_gtk_entry_get_borders (entry, &xborder, &yborder);
......@@ -3044,7 +3046,8 @@ get_widget_window_size (GtkEntry *entry,
GtkRequisition requisition;
GtkWidget *widget = GTK_WIDGET (entry);
gtk_widget_get_child_requisition (widget, &requisition);
gtk_size_request_get_size (GTK_SIZE_REQUEST (widget),
&requisition, NULL);
gtk_widget_get_allocation (widget, &allocation);
if (x)
......@@ -3106,10 +3109,6 @@ gtk_entry_size_allocate (GtkWidget *widget,
if (gtk_widget_get_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
*/
gint x, y, width, height;
GtkEntryCompletion* completion;
......
......@@ -451,7 +451,8 @@ gtk_expander_realize (GtkWidget *widget)
{
GtkRequisition label_requisition;
gtk_widget_get_child_requisition (priv->label_widget, &label_requisition);
gtk_size_request_get_size (GTK_SIZE_REQUEST (priv->label_widget),
&label_requisition, NULL);
label_height = label_requisition.height;
}
else
......
......@@ -25,7 +25,11 @@
*/
#include "config.h"
#include "gtkfixed.h"
#include "gtksizerequest.h"
#include "gtkprivate.h"
#include "gtkintl.h"
......@@ -398,7 +402,8 @@ gtk_fixed_size_allocate (GtkWidget *widget,
if (gtk_widget_get_visible (child->widget))
{
gtk_widget_get_child_requisition (child->widget, &child_requisition);
gtk_size_request_get_size (GTK_SIZE_REQUEST (child->widget),
&child_requisition, NULL);
child_allocation.x = child->x + border_width;
child_allocation.y = child->y + border_width;
......
......@@ -1173,8 +1173,9 @@ gtk_font_selection_update_preview (GtkFontSelection *fontsel)
GtkWidget *preview_entry = priv->preview_entry;
const gchar *text;
gtk_widget_get_child_requisition (preview_entry, &old_requisition);
gtk_size_request_get_size (GTK_SIZE_REQUEST (preview_entry),
&old_requisition, NULL);
rc_style = gtk_rc_style_new ();
rc_style->font_desc = gtk_font_selection_get_font_description (fontsel);
......
......@@ -645,7 +645,10 @@ gtk_handle_box_size_allocate (GtkWidget *widget,
child = gtk_bin_get_child (bin);
if (child)
gtk_widget_get_child_requisition (child, &child_requisition);
{
gtk_size_request_get_size (GTK_SIZE_REQUEST (child),
&child_requisition, NULL);
}
else
{
child_requisition.width = 0;
......@@ -1379,7 +1382,10 @@ gtk_handle_box_motion (GtkWidget *widget,
priv->child_detached = TRUE;
if (child)
gtk_widget_get_child_requisition (child, &child_requisition);
{
gtk_size_request_get_size (GTK_SIZE_REQUEST (child),
&child_requisition, NULL);
}
else
{
child_requisition.width = 0;
......
......@@ -25,9 +25,10 @@
*/
#include "config.h"
#include "gtkimagemenuitem.h"
#include "gtkaccellabel.h"
#include "gtkintl.h"
#include "gtkstock.h"
#include "gtkiconfactory.h"
#include "gtkimage.h"
......@@ -35,6 +36,9 @@
#include "gtkcontainer.h"
#include "gtkwindow.h"
#include "gtkactivatable.h"
#include "gtksizerequest.h"
#include "gtkintl.h"
#include "gtkprivate.h"
......@@ -341,8 +345,9 @@ gtk_image_menu_item_toggle_size_request (GtkMenuItem *menu_item,
{
GtkRequisition image_requisition;
guint toggle_spacing;
gtk_widget_get_child_requisition (priv->image,
&image_requisition);
gtk_size_request_get_size (GTK_SIZE_REQUEST (priv->image),
&image_requisition, NULL);
gtk_widget_style_get (GTK_WIDGET (menu_item),
"toggle-spacing", &toggle_spacing,
......@@ -496,8 +501,8 @@ gtk_image_menu_item_size_allocate (GtkWidget *widget,
* come up with a solution that's really better.
*/
gtk_widget_get_child_requisition (priv->image,
&child_requisition);
gtk_size_request_get_size (GTK_SIZE_REQUEST (priv->image),
&child_requisition, NULL);
gtk_widget_get_allocation (widget, &widget_allocation);
......
......@@ -29,9 +29,13 @@
*/
#include "config.h"
#include "gdkconfig.h"
#include "gtklayout.h"
#include "gdkconfig.h"
#include "gtksizerequest.h"
#include "gtkprivate.h"
#include "gtkintl.h"
#include "gtkmarshalers.h"
......@@ -1124,7 +1128,9 @@ gtk_layout_allocate_child (GtkLayout *layout,
allocation.x = child->x;
allocation.y = child->y;
gtk_widget_get_child_requisition (child->widget, &requisition);
gtk_size_request_get_size (GTK_SIZE_REQUEST (child->widget),
&requisition, NULL);
allocation.width = requisition.width;
allocation.height = requisition.height;
......
......@@ -25,16 +25,20 @@
*/
#include "config.h"
#include "gtkmenubar.h"
#include "gdk/gdkkeysyms.h"
#include "gtkbindings.h"
#include "gtkmain.h"
#include "gtkmarshalers.h"
#include "gtkmenubar.h"
#include "gtkmenuitem.h"
#include "gtkmenuprivate.h"
#include "gtksettings.h"
#include "gtkintl.h"
#include "gtksizerequest.h"
#include "gtkwindow.h"
#include "gtkintl.h"
#include "gtkprivate.h"
#define BORDER_SPACING 0
......@@ -424,8 +428,9 @@ gtk_menu_bar_size_allocate (GtkWidget *widget,
gtk_menu_item_toggle_size_request (GTK_MENU_ITEM (child),
&toggle_size);
gtk_widget_get_child_requisition (child, &child_requisition);
gtk_size_request_get_size (GTK_SIZE_REQUEST (child),
&child_requisition, NULL);
if (priv->child_pack_direction == GTK_PACK_DIRECTION_LTR ||
priv->child_pack_direction == GTK_PACK_DIRECTION_RTL)
child_requisition.width += toggle_size;
......@@ -474,8 +479,9 @@ gtk_menu_bar_size_allocate (GtkWidget *widget,
gtk_menu_item_toggle_size_request (GTK_MENU_ITEM (child),
&toggle_size);
gtk_widget_get_child_requisition (child, &child_requisition);
gtk_size_request_get_size (GTK_SIZE_REQUEST (child),
&child_requisition, NULL);
if (priv->child_pack_direction == GTK_PACK_DIRECTION_LTR ||
priv->child_pack_direction == GTK_PACK_DIRECTION_RTL)
child_requisition.width += toggle_size;
......
......@@ -1394,7 +1394,8 @@ gtk_menu_item_size_allocate (GtkWidget *widget,
child_allocation.x += allocation->x;
child_allocation.y += allocation->y;
gtk_widget_get_child_requisition (child, &child_requisition);
gtk_size_request_get_size (GTK_SIZE_REQUEST (child),
&child_requisition, NULL);
if (menu_item->submenu && menu_item->show_submenu_indicator)
{
if (direction == GTK_TEXT_DIR_RTL)
......
......@@ -27,16 +27,18 @@
#include "config.h"
#include "gtknotebook.h"
#include <stdio.h>
#include <string.h>
#include <gdk/gdkkeysyms.h>
#include "gtknotebook.h"
#include "gtkmain.h"
#include "gtkmenu.h"
#include "gtkmenuitem.h"
#include "gtklabel.h"
#include "gtksizerequest.h"
#include "gtkintl.h"
#include "gtkmarshalers.h"
#include "gtkbindings.h"
......@@ -2199,7 +2201,8 @@ gtk_notebook_size_allocate (GtkWidget *widget,
widget_allocation.y = allocation->y + border_width;
is_rtl = gtk_widget_get_direction (widget) == GTK_TEXT_DIR_RTL;
gtk_widget_get_child_requisition (priv->action_widget[i], &requisition);
gtk_size_request_get_size (GTK_SIZE_REQUEST (priv->action_widget[i]),
&requisition, NULL);
switch (tab_pos)
{
......@@ -5912,7 +5915,8 @@ gtk_notebook_page_allocate (GtkNotebook *notebook,
xthickness = style->xthickness;
ythickness = style->ythickness;
gtk_widget_get_child_requisition (page->tab_label, &tab_requisition);
gtk_size_request_get_size (GTK_SIZE_REQUEST (page->tab_label),
&tab_requisition, NULL);
gtk_widget_style_get (widget,
"focus-line-width", &focus_width,
"tab-curvature", &tab_curvature,
......
......@@ -26,13 +26,16 @@
#include "config.h"
#include "gtkpaned.h"
#include "gdk/gdkkeysyms.h"
#include "gtkbindings.h"
#include "gtkmain.h"
#include "gtkmarshalers.h"
#include "gtkorientable.h"
#include "gtkpaned.h"
#include "gtksizerequest.h"
#include "gtkwindow.h"
#include "gtkprivate.h"
#include "gtkintl.h"
......@@ -884,8 +887,10 @@ gtk_paned_size_allocate (GtkWidget *widget,
gtk_widget_style_get (widget, "handle-size", &handle_size, NULL);
gtk_widget_get_child_requisition (priv->child1, &child1_requisition);
gtk_widget_get_child_requisition (priv->child2, &child2_requisition);
gtk_size_request_get_size (GTK_SIZE_REQUEST (priv->child1),
&child1_requisition, NULL);
gtk_size_request_get_size (GTK_SIZE_REQUEST (priv->child2),
&child2_requisition, NULL);
old_handle_pos = priv->handle_pos;
......
......@@ -19,8 +19,11 @@
*/
#include "config.h"
#include <string.h>
#include "gtkpathbar.h"
#include <string.h>
#include "gtktogglebutton.h"
#include "gtkalignment.h"
#include "gtkarrow.h"
......@@ -33,6 +36,7 @@
#include "gtkhbox.h"
#include "gtkmain.h"
#include "gtkmarshalers.h"
#include "gtksizerequest.h"
enum {
......@@ -493,7 +497,8 @@ gtk_path_bar_size_allocate (GtkWidget *widget,
{
child = BUTTON_DATA (list->data)->button;
gtk_widget_get_child_requisition (child, &child_requisition);
gtk_size_request_get_size (GTK_SIZE_REQUEST (child),
&child_requisition, NULL);
width += child_requisition.width + path_bar->spacing;
if (list == path_bar->fake_root)
......@@ -523,7 +528,8 @@ gtk_path_bar_size_allocate (GtkWidget *widget,
* button, then count backwards.
*/
/* Count down the path chain towards the end. */
gtk_widget_get_child_requisition (BUTTON_DATA (first_button->data)->button, &child_requisition);
gtk_size_request_get_size (GTK_SIZE_REQUEST (BUTTON_DATA (first_button->data)->button),
&child_requisition, NULL);
width = child_requisition.width;
list = first_button->prev;
......@@ -531,7 +537,8 @@ gtk_path_bar_size_allocate (GtkWidget *widget,
{
child = BUTTON_DATA (list->data)->button;
gtk_widget_get_child_requisition (child, &child_requisition);
gtk_size_request_get_size (GTK_SIZE_REQUEST (child),
&child_requisition, NULL);
if (width + child_requisition.width +
path_bar->spacing + slider_space > allocation_width)
......@@ -550,7 +557,8 @@ gtk_path_bar_size_allocate (GtkWidget *widget,
{
child = BUTTON_DATA (first_button->next->data)->button;
gtk_widget_get_child_requisition (child, &child_requisition);
gtk_size_request_get_size (GTK_SIZE_REQUEST (child),
&child_requisition, NULL);
if (width + child_requisition.width + path_bar->spacing + slider_space > allocation_width)
{
......@@ -597,7 +605,8 @@ gtk_path_bar_size_allocate (GtkWidget *widget,
button_data = BUTTON_DATA (list->data);
child = button_data->button;
gtk_widget_get_child_requisition (child, &child_requisition);
gtk_size_request_get_size (GTK_SIZE_REQUEST (child),
&child_requisition, NULL);
child_allocation.width = MIN (child_requisition.width,
allocation_width - (path_bar->spacing + path_bar->slider_width) * 2);
......
......@@ -1346,8 +1346,8 @@ gtk_scrolled_window_relative_allocation (GtkWidget *widget,
GtkRequisition vscrollbar_requisition;
gboolean is_rtl;
gtk_widget_get_child_requisition (priv->vscrollbar,
&vscrollbar_requisition);
gtk_size_request_get_size (GTK_SIZE_REQUEST (priv->vscrollbar),
&vscrollbar_requisition, NULL);
is_rtl = gtk_widget_get_direction (widget) == GTK_TEXT_DIR_RTL;
if ((!is_rtl &&
......@@ -1363,8 +1363,9 @@ gtk_scrolled_window_relative_allocation (GtkWidget *widget,
if (priv->hscrollbar_visible)
{
GtkRequisition hscrollbar_requisition;
gtk_widget_get_child_requisition (priv->hscrollbar,
&hscrollbar_requisition);
gtk_size_request_get_size (GTK_SIZE_REQUEST (priv->hscrollbar),
&hscrollbar_requisition, NULL);
if (priv->real_window_placement == GTK_CORNER_BOTTOM_LEFT ||
priv->real_window_placement == GTK_CORNER_BOTTOM_RIGHT)
......@@ -1466,8 +1467,9 @@ gtk_scrolled_window_size_allocate (GtkWidget *widget,
if (priv->hscrollbar_visible)
{
GtkRequisition hscrollbar_requisition;
gtk_widget_get_child_requisition (priv->hscrollbar,
&hscrollbar_requisition);
gtk_size_request_get_size (GTK_SIZE_REQUEST (priv->hscrollbar),
&hscrollbar_requisition, NULL);
if (!gtk_widget_get_visible (priv->hscrollbar))
gtk_widget_show (priv->hscrollbar);
......@@ -1517,8 +1519,8 @@ gtk_scrolled_window_size_allocate (GtkWidget *widget,
if (!gtk_widget_get_visible (priv->vscrollbar))
gtk_widget_show (priv->vscrollbar);
gtk_widget_get_child_requisition (priv->vscrollbar,
&vscrollbar_requisition);
gtk_size_request_get_size (GTK_SIZE_REQUEST (priv->vscrollbar),
&vscrollbar_requisition, NULL);
if ((gtk_widget_get_direction (widget) == GTK_TEXT_DIR_RTL &&
(priv->real_window_placement == GTK_CORNER_TOP_RIGHT ||
......
......@@ -25,8 +25,11 @@
*/
#include "config.h"
#include "gtktable.h"
#include "gtkprivate.h"
#include "gtksizerequest.h"
#include "gtkintl.h"
......@@ -1064,7 +1067,9 @@ gtk_table_size_request_pass1 (GtkTable *table)
if (gtk_widget_get_visible (child->widget))
{
GtkRequisition child_requisition;
gtk_widget_get_child_requisition (child->widget, &child_requisition);
gtk_size_request_get_size (GTK_SIZE_REQUEST (child->widget),
&child_requisition, NULL);
/* Child spans a single column.
*/
......@@ -1134,8 +1139,9 @@ gtk_table_size_request_pass3 (GtkTable *table)
{
GtkRequisition child_requisition;
gtk_widget_get_child_requisition (child->widget, &child_requisition);
gtk_size_request_get_size (GTK_SIZE_REQUEST (child->widget),
&child_requisition, NULL);
/* Check and see if there is already enough space
* for the child.
*/
......@@ -1185,7 +1191,8 @@ gtk_table_size_request_pass3 (GtkTable *table)
{
GtkRequisition child_requisition;
gtk_widget_get_child_requisition (child->widget, &child_requisition);
gtk_size_request_get_size (GTK_SIZE_REQUEST (child->widget),
&child_requisition, NULL);
/* Check and see if there is already enough space
* for the child.
......@@ -1662,7 +1669,8 @@ gtk_table_size_allocate_pass2 (GtkTable *table)
GtkRequisition child_requisition;
guint border_width;
gtk_widget_get_child_requisition (child->widget, &child_requisition);
gtk_size_request_get_size (GTK_SIZE_REQUEST (child->widget),
&child_requisition, NULL);
gtk_widget_get_allocation (GTK_WIDGET (table), &table_allocation);
border_width = gtk_container_get_border_width (GTK_CONTAINER (table));
......
......@@ -1614,8 +1614,9 @@ add_child_attrs (GtkTextLayout *layout,
/* Found it */
GtkRequisition req;
gtk_widget_get_child_requisition (child, &req);
gtk_size_request_get_size (GTK_SIZE_REQUEST (child),
&req, NULL);
width = req.width;
height = req.height;
......
......@@ -3309,11 +3309,13 @@ gtk_text_view_size_request (GtkWidget *widget,
GtkRequisition child_req;
GtkRequisition old_req;
gtk_widget_get_child_requisition (child->widget, &old_req);
gtk_size_request_get_size (GTK_SIZE_REQUEST (child->widget),
&old_req, NULL);
gtk_widget_size_request (child->widget, &child_req);
gtk_widget_get_child_requisition (child->widget, &child_req);
gtk_size_request_get_size (GTK_SIZE_REQUEST (child->widget),
&child_req, NULL);
/* Invalidate layout lines if required */
if (priv->layout &&
......@@ -3358,7 +3360,8 @@ gtk_text_view_compute_child_allocation (GtkTextView *text_view,
allocation->x = vc->from_left_of_buffer - text_view->priv->xoffset;
allocation->y = buffer_y - text_view->priv->yoffset;
gtk_widget_get_child_requisition (vc->widget, &req);
gtk_size_request_get_size (GTK_SIZE_REQUEST (vc->widget),
&req, NULL);
allocation->width = req.width;
allocation->height = req.height;
}
......@@ -3459,8 +3462,9 @@ gtk_text_view_allocate_children (GtkTextView *text_view)
allocation.x = child->x;
allocation.y = child->y;
gtk_widget_get_child_requisition (child->widget, &child_req);
gtk_size_request_get_size (GTK_SIZE_REQUEST (child->widget),
&child_req, NULL);
allocation.width = child_req.width;
allocation.height = child_req.height;
......
......@@ -32,6 +32,8 @@
#include "config.h"
#include "gtktoolbar.h"
#include <math.h>
#include <string.h>
......@@ -51,7 +53,7 @@
#include "gtkseparatormenuitem.h"
#include "gtkseparatortoolitem.h"
#include "gtkstock.h"
#include "gtktoolbar.h"
#include "gtksizerequest.h"
#include "gtktoolshell.h"
#include "gtkvbox.h"
#include "gtkprivate.h"
......@@ -1454,10 +1456,10 @@ gtk_toolbar_size_allocate (GtkWidget *widget,
}
border_width += get_internal_padding (toolbar);
gtk_widget_get_child_requisition (GTK_WIDGET (priv->arrow_button),
&arrow_requisition);
gtk_size_request_get_size (GTK_SIZE_REQUEST (priv->arrow_button),
&arrow_requisition, NULL);
shadow_type = get_shadow_type (toolbar);
if (priv->orientation == GTK_ORIENTATION_HORIZONTAL)
......
......@@ -443,8 +443,9 @@ viewport_set_hadjustment_values (GtkViewport *viewport,
if (child && gtk_widget_get_visible (child))
{
GtkRequisition child_requisition;
gtk_widget_get_child_requisition (child, &child_requisition);
gtk_size_request_get_size (GTK_SIZE_REQUEST (child),
&child_requisition, NULL);
hadjustment->upper = MAX (child_requisition.width, view_allocation.width);
}
else
......
......@@ -5806,7 +5806,8 @@ gtk_window_compute_configure_request_size (GtkWindow *window,
if (priv->need_default_size)
{
gtk_widget_get_child_requisition (widget, &requisition);
gtk_size_request_get_size (GTK_SIZE_REQUEST (widget),
&requisition, NULL);
/* Default to requisition */
*width = requisition.width;
......@@ -6727,8 +6728,8 @@ gtk_window_compute_hints (GtkWindow *window,
GtkRequisition requisition;
widget = GTK_WIDGET (window);
gtk_widget_get_child_requisition (widget, &requisition);
gtk_size_request_get_size (GTK_SIZE_REQUEST (widget), &requisition, NULL);
geometry_info = gtk_window_get_geometry_info (GTK_WINDOW (widget), FALSE);
if (geometry_info)
......@@ -6758,9 +6759,11 @@ gtk_window_compute_hints (GtkWindow *window,
*
* Finding these answers would be a bit of a mess here. (Bug #68668)
*/
gtk_widget_get_child_requisition (geometry_info->widget, &child_requisition);
gtk_size_request_get_size (GTK_SIZE_REQUEST (geometry_info->widget),
&child_requisition, NULL);
gtk_size_request_get_size (GTK_SIZE_REQUEST (widget), &requisition, NULL);
gtk_size_request_get_size (GTK_SIZE_REQUEST (widget),
&requisition, NULL);
extra_width = requisition.width - child_requisition.width;
extra_height = requisition.height - child_requisition.height;
}
......
......@@ -528,7 +528,8 @@ gtk_offscreen_box_size_allocate (GtkWidget *widget,
GtkRequisition child_requisition;
GtkAllocation child_allocation;
gtk_widget_get_child_requisition (offscreen_box->child1, &child_requisition);
gtk_size_request_get_size (GTK_SIZE_REQUEST (offscreen_box->child1),
&child_requisition, NULL);
child_allocation.x = child_requisition.width * (CHILD1_SIZE_SCALE - 1.0) / 2;
child_allocation.y = start_y + child_requisition.height * (CHILD1_SIZE_SCALE - 1.0) / 2;
child_allocation.width = MAX (1, (gint) allocation->width - 2 * border_width);
......@@ -552,7 +553,8 @@ gtk_offscreen_box_size_allocate (GtkWidget *widget,
GtkRequisition child_requisition;
GtkAllocation child_allocation;
gtk_widget_get_child_requisition (offscreen_box->child2, &child_requisition);
gtk_size_request_get_size (GTK_SIZE_REQUEST (offscreen_box->child2),
&child_requisition, NULL);
child_allocation.x = child_requisition.width * (CHILD2_SIZE_SCALE - 1.0) / 2;
child_allocation.y = start_y + child_requisition.height * (CHILD2_SIZE_SCALE - 1.0) / 2;
child_allocation.width = MAX (1, (gint) allocation->width - 2 * border_width);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment