[gtk+/native-layout] Changed initial values for requisition from -1 to 0.
- From: Tristan Van Berkom <tvb src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+/native-layout] Changed initial values for requisition from -1 to 0.
- Date: Sun, 4 Apr 2010 20:40:01 +0000 (UTC)
commit 4b1315cedce54d5af15ddef456e460b887f0e96e
Author: Tristan Van Berkom <tristan van berkom gmail com>
Date: Sun Apr 4 16:38:36 2010 -0400
Changed initial values for requisition from -1 to 0.
When doing size-requests and get_natural_size() calls, use 0 as
the base value instead of -1, because size_request code assumes
that widget->requesition is initialized at 0.
gtk/gtksizegroup.c | 6 +++---
gtk/gtkwidget.c | 10 ++--------
2 files changed, 5 insertions(+), 11 deletions(-)
---
diff --git a/gtk/gtksizegroup.c b/gtk/gtksizegroup.c
index 2dcde99..96772ee 100644
--- a/gtk/gtksizegroup.c
+++ b/gtk/gtksizegroup.c
@@ -670,9 +670,9 @@ do_size_request (GtkWidget *widget)
* Note here that there is no convention of filling the argument or widget->requisition,
* so we have no choice but to fire size request with this pointer.
*/
- g_signal_emit_by_name (widget,
- "size-request",
- &widget->requisition);
+ widget->requisition.width = 0;
+ widget->requisition.height = 0;
+ g_signal_emit_by_name (widget, "size-request", &widget->requisition);
/* Now get the extended layout minimum and natural size
*/
diff --git a/gtk/gtkwidget.c b/gtk/gtkwidget.c
index 0c7d12d..9f33530 100644
--- a/gtk/gtkwidget.c
+++ b/gtk/gtkwidget.c
@@ -10724,16 +10724,10 @@ gtk_widget_real_get_desired_size (GtkExtendedLayout *layout,
* on the "size-request" collected values (see gtksizegroup.c:do_size_request()).
*/
if (minimum_size)
- {
- minimum_size->width = -1;
- minimum_size->height = -1;
- }
+ memset (minimum_size, 0x0, sizeof (GtkRequisition));
if (natural_size)
- {
- natural_size->width = -1;
- natural_size->height = -1;
- }
+ memset (natural_size, 0x0, sizeof (GtkRequisition));
}
static void
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]