[gtkdatabox] Bugfix Gdk-CRITICAL messages at application startup



Just apply this patch on top of GTK2 branch, the widget allocated size when the widget window is null.

Cya

Joaquín
>From e91e55723b3392234aff25db9c7a70d2e9a01186 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Joaqu=C3=ADn=20Ignacio=20Aramend=C3=ADa?= <samsagax gmail com>
Date: Fri, 16 Nov 2012 13:24:41 -0300
Subject: [PATCH] Bugfix: Don't allocate size if widget is not realized.
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Prevents "Gdk-CRITICAL" message in application startup as the GtkDatabox
widget won't have a non-null window pointer.

Signed-off-by: Joaquín Ignacio Aramendía <samsagax gmail com>
---
 gtk/gtkdatabox.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/gtk/gtkdatabox.c b/gtk/gtkdatabox.c
index 3be189b..2e5356d 100644
--- a/gtk/gtkdatabox.c
+++ b/gtk/gtkdatabox.c
@@ -1119,6 +1119,8 @@ static void
 gtk_databox_size_allocate (GtkWidget * widget, GtkAllocation * allocation) {
     GtkDatabox *box = GTK_DATABOX (widget);
 
+    if (!gtk_widget_get_realized(widget))
+        return;
     widget->allocation = *allocation;
 
         gdk_window_move_resize (widget->window,
-- 
1.8.0



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]