Commit bc0e6b2b authored by Michael Natterer's avatar Michael Natterer 😴

gtk: remove GtkWidget::size-request

Fixes Bug 633324 - Stop invoking size-request completely
parent 3431f7a2
......@@ -105,29 +105,6 @@ get_cached_size (SizeRequestCache *cache,
}
extern guint _size_request_signal_id;
static void
do_size_request (GtkWidget *widget,
GtkRequisition *requisition)
{
GtkWidgetClass *widget_class = g_type_class_peek (GTK_TYPE_WIDGET);
if (GTK_WIDGET_GET_CLASS (widget)->size_request != widget_class->size_request)
g_warning ("%s implements GtkWidgetClass::size_request which is deprecated and "
"will be removed in the next release",
G_OBJECT_TYPE_NAME (widget));
if (g_signal_has_handler_pending (widget, _size_request_signal_id, 0, TRUE))
g_warning ("A %s (%p) has handler(s) connected to the GtkWidgetClass::size-request signal which is "
"deprecated and will be removed in the next release",
G_OBJECT_TYPE_NAME (widget), widget);
/* Now we dont bother caching the deprecated "size-request" returns,
* just unconditionally invoke here just in case we run into legacy stuff */
gtk_widget_ensure_style (widget);
g_signal_emit_by_name (widget, "size-request", requisition);
}
#ifndef G_DISABLE_CHECKS
static GQuark recursion_check_quark = 0;
#endif /* G_DISABLE_CHECKS */
......@@ -225,17 +202,13 @@ compute_size_for_orientation (GtkWidget *widget,
if (!found_in_cache)
{
GtkRequisition requisition = { 0, 0 };
gint min_size = 0, nat_size = 0;
gint requisition_size;
gint min_size = 0;
gint nat_size = 0;
/* Unconditional size request runs but is often unhandled. */
do_size_request (widget, &requisition);
gtk_widget_ensure_style (widget);
if (orientation == GTK_SIZE_GROUP_HORIZONTAL)
{
requisition_size = requisition.width;
if (for_size < 0)
{
push_recursion_check (widget, orientation, for_size);
......@@ -266,8 +239,6 @@ compute_size_for_orientation (GtkWidget *widget,
}
else
{
requisition_size = requisition.height;
if (for_size < 0)
{
push_recursion_check (widget, orientation, for_size);
......@@ -303,12 +274,6 @@ compute_size_for_orientation (GtkWidget *widget,
G_OBJECT_TYPE_NAME (widget), widget, min_size, nat_size);
}
/* Support for dangling "size-request" signal implementations on
* legacy widgets
*/
min_size = MAX (min_size, requisition_size);
nat_size = MAX (nat_size, requisition_size);
cached_size->minimum_size = min_size;
cached_size->natural_size = nat_size;
cached_size->for_size = for_size;
......
......@@ -381,7 +381,6 @@ enum {
UNMAP,
REALIZE,
UNREALIZE,
SIZE_REQUEST,
SIZE_ALLOCATE,
STATE_CHANGED,
PARENT_SET,
......@@ -517,8 +516,6 @@ static void gtk_widget_real_map (GtkWidget *widget);
static void gtk_widget_real_unmap (GtkWidget *widget);
static void gtk_widget_real_realize (GtkWidget *widget);
static void gtk_widget_real_unrealize (GtkWidget *widget);
static void gtk_widget_real_size_request (GtkWidget *widget,
GtkRequisition *requisition);
static void gtk_widget_real_size_allocate (GtkWidget *widget,
GtkAllocation *allocation);
static void gtk_widget_real_style_set (GtkWidget *widget,
......@@ -655,9 +652,6 @@ static guint composite_child_stack = 0;
static GtkTextDirection gtk_default_direction = GTK_TEXT_DIR_LTR;
static GParamSpecPool *style_property_spec_pool = NULL;
/* XXX Temporarily here to fire warnings from gtksizerequest.c */
guint _size_request_signal_id = 0;
static GQuark quark_property_parser = 0;
static GQuark quark_aux_info = 0;
static GQuark quark_accel_path = 0;
......@@ -813,7 +807,6 @@ gtk_widget_class_init (GtkWidgetClass *klass)
klass->unmap = gtk_widget_real_unmap;
klass->realize = gtk_widget_real_realize;
klass->unrealize = gtk_widget_real_unrealize;
klass->size_request = gtk_widget_real_size_request;
klass->size_allocate = gtk_widget_real_size_allocate;
klass->get_preferred_width = gtk_widget_real_get_width;
klass->get_preferred_height = gtk_widget_real_get_height;
......@@ -1410,25 +1403,6 @@ gtk_widget_class_init (GtkWidgetClass *klass)
_gtk_marshal_VOID__VOID,
G_TYPE_NONE, 0);
/**
* GtkWidget::size-request:
* @widget: the object which received the signal.
* @requisition:
*
* Deprecated: 3.0: Either implement
* <link linkend="geometry-management">height-for-width geometry management</link> or
* use gtk_widget_set_size_request() instead of handling this signal.
*/
_size_request_signal_id = widget_signals[SIZE_REQUEST] =
g_signal_new (I_("size-request"),
G_TYPE_FROM_CLASS (gobject_class),
G_SIGNAL_RUN_FIRST,
G_STRUCT_OFFSET (GtkWidgetClass, size_request),
NULL, NULL,
_gtk_marshal_VOID__BOXED,
G_TYPE_NONE, 1,
GTK_TYPE_REQUISITION | G_SIGNAL_TYPE_STATIC_SCOPE);
/**
* GtkWidget::size-allocate:
* @widget: the object which received the signal.
......@@ -9881,14 +9855,6 @@ gtk_widget_real_unrealize (GtkWidget *widget)
gtk_widget_set_realized (widget, FALSE);
}
static void
gtk_widget_real_size_request (GtkWidget *widget,
GtkRequisition *requisition)
{
requisition->width = 0;
requisition->height = 0;
}
static void
gtk_widget_real_adjust_size_request (GtkWidget *widget,
GtkOrientation orientation,
......
......@@ -219,8 +219,6 @@ struct _GtkWidgetClass
void (* unmap) (GtkWidget *widget);
void (* realize) (GtkWidget *widget);
void (* unrealize) (GtkWidget *widget);
void (* size_request) (GtkWidget *widget,
GtkRequisition *requisition);
void (* size_allocate) (GtkWidget *widget,
GtkAllocation *allocation);
void (* state_changed) (GtkWidget *widget,
......
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