[gtk+] widget: Add a function that does actual resize
- From: Benjamin Otte <otte src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+] widget: Add a function that does actual resize
- Date: Wed, 28 Oct 2015 18:58:12 +0000 (UTC)
commit 3ff894c2013f41a90b4fec4ffbefb17fcd2b45ab
Author: Benjamin Otte <otte redhat com>
Date: Sun Sep 27 12:29:05 2015 +0200
widget: Add a function that does actual resize
It's just shuffling code around.
gtk/gtksizegroup.c | 4 +---
gtk/gtkwidget.c | 8 +++++---
gtk/gtkwidgetprivate.h | 4 ++--
3 files changed, 8 insertions(+), 8 deletions(-)
---
diff --git a/gtk/gtksizegroup.c b/gtk/gtksizegroup.c
index 11f050c..3eddc1f 100644
--- a/gtk/gtksizegroup.c
+++ b/gtk/gtksizegroup.c
@@ -26,7 +26,6 @@
#include "gtktypebuiltins.h"
#include "gtkprivate.h"
#include "gtksizegroup-private.h"
-#include "gtksizerequestcacheprivate.h"
#include "gtkwidgetprivate.h"
#include "gtkcontainerprivate.h"
@@ -218,8 +217,7 @@ queue_resize_on_widget (GtkWidget *widget,
do
{
- _gtk_widget_set_alloc_needed (parent, TRUE);
- _gtk_size_request_cache_clear (_gtk_widget_peek_request_cache (parent));
+ gtk_widget_queue_resize_on_widget (parent);
if (!check_siblings || _gtk_widget_get_sizegroups (parent) == NULL)
{
diff --git a/gtk/gtkwidget.c b/gtk/gtkwidget.c
index b0713bf..4b34153 100644
--- a/gtk/gtkwidget.c
+++ b/gtk/gtkwidget.c
@@ -16157,10 +16157,12 @@ _gtk_widget_get_alloc_needed (GtkWidget *widget)
}
void
-_gtk_widget_set_alloc_needed (GtkWidget *widget,
- gboolean alloc_needed)
+gtk_widget_queue_resize_on_widget (GtkWidget *widget)
{
- widget->priv->alloc_needed = alloc_needed;
+ GtkWidgetPrivate *priv = widget->priv;
+
+ priv->alloc_needed = TRUE;
+ _gtk_size_request_cache_clear (&priv->requests);
}
void
diff --git a/gtk/gtkwidgetprivate.h b/gtk/gtkwidgetprivate.h
index aefa4f8..aa69230 100644
--- a/gtk/gtkwidgetprivate.h
+++ b/gtk/gtkwidgetprivate.h
@@ -72,6 +72,7 @@ struct _GtkWidgetPrivate
guint in_reparent : 1;
/* Queue-resize related flags */
+ guint resize_needed : 1; /* queue_resize() has been called but no get_preferred_size() yet */
guint alloc_needed : 1;
/* Expand-related flags */
@@ -165,8 +166,7 @@ gboolean _gtk_widget_get_shadowed (GtkWidget *widget);
void _gtk_widget_set_shadowed (GtkWidget *widget,
gboolean shadowed);
gboolean _gtk_widget_get_alloc_needed (GtkWidget *widget);
-void _gtk_widget_set_alloc_needed (GtkWidget *widget,
- gboolean alloc_needed);
+void gtk_widget_queue_resize_on_widget (GtkWidget *widget);
void _gtk_widget_draw (GtkWidget *widget,
cairo_t *cr);
void _gtk_widget_scale_changed (GtkWidget *widget);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]