[gnome-control-center] color: Only attempt to get the main window after the widget has been realized
- From: Richard Hughes <rhughes src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-control-center] color: Only attempt to get the main window after the widget has been realized
- Date: Wed, 1 Jun 2011 17:24:17 +0000 (UTC)
commit f4228e48cef8555203dc4d976d9c4df73f7b3d25
Author: Richard Hughes <richard hughsie com>
Date: Wed Jun 1 18:18:18 2011 +0100
color: Only attempt to get the main window after the widget has been realized
This fixes a critical warning when adding a profile.
panels/color/cc-color-panel.c | 10 +++++++++-
1 files changed, 9 insertions(+), 1 deletions(-)
---
diff --git a/panels/color/cc-color-panel.c b/panels/color/cc-color-panel.c
index b97ea4e..e82b2e9 100644
--- a/panels/color/cc-color-panel.c
+++ b/panels/color/cc-color-panel.c
@@ -1947,6 +1947,12 @@ gcm_prefs_connect_cb (GObject *object,
}
static void
+gcm_prefs_window_realize_cb (GtkWidget *widget, CcColorPanel *prefs)
+{
+ prefs->priv->main_window = gtk_widget_get_toplevel (widget);
+}
+
+static void
cc_color_panel_get_property (GObject *object,
guint property_id,
GValue *value,
@@ -2223,7 +2229,9 @@ cc_color_panel_init (CcColorPanel *prefs)
widget = WID (priv->builder, "dialog-vbox1");
gtk_widget_reparent (widget, (GtkWidget *) prefs);
- priv->main_window = gtk_widget_get_toplevel (widget);
+ g_signal_connect (widget, "realize",
+ G_CALLBACK (gcm_prefs_window_realize_cb),
+ prefs);
}
void
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]