aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorCosimo Cecchi <cosimoc@gnome.org>2011-02-09 03:44:58 +0800
committerCosimo Cecchi <cosimoc@gnome.org>2011-02-10 01:46:25 +0800
commitfd7763a53b2e67de8676d34f6a755202832bf363 (patch)
tree7706c4d76b5676712bfc6f93f088301fd0133b88 /src
parentc61ceefda501caad3efc8cad84662972d3652baa (diff)
downloadgsoc2013-empathy-fd7763a53b2e67de8676d34f6a755202832bf363.tar
gsoc2013-empathy-fd7763a53b2e67de8676d34f6a755202832bf363.tar.gz
gsoc2013-empathy-fd7763a53b2e67de8676d34f6a755202832bf363.tar.bz2
gsoc2013-empathy-fd7763a53b2e67de8676d34f6a755202832bf363.tar.lz
gsoc2013-empathy-fd7763a53b2e67de8676d34f6a755202832bf363.tar.xz
gsoc2013-empathy-fd7763a53b2e67de8676d34f6a755202832bf363.tar.zst
gsoc2013-empathy-fd7763a53b2e67de8676d34f6a755202832bf363.zip
cc-panel: make sure to always pack a widget during construction
The CC library expects the panel to have a child widget after it's constructed, otherwise it segfaults. https://bugzilla.gnome.org/show_bug.cgi?id=641867
Diffstat (limited to 'src')
-rw-r--r--src/cc-empathy-accounts-panel.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/cc-empathy-accounts-panel.c b/src/cc-empathy-accounts-panel.c
index 24be69121..1fff907f1 100644
--- a/src/cc-empathy-accounts-panel.c
+++ b/src/cc-empathy-accounts-panel.c
@@ -52,6 +52,7 @@ struct CcEmpathyAccountsPanelPrivate
GtkWidget *accounts_window;
GtkWidget *assistant;
+ GtkWidget *container;
};
G_DEFINE_DYNAMIC_TYPE (CcEmpathyAccountsPanel, cc_empathy_accounts_panel, CC_TYPE_PANEL)
@@ -79,7 +80,7 @@ panel_pack_with_accounts_dialog (CcEmpathyAccountsPanel *panel)
gtk_widget_set_no_show_all (action_area, TRUE);
gtk_widget_hide (action_area);
- gtk_widget_reparent (content, GTK_WIDGET (panel));
+ gtk_widget_reparent (content, GTK_WIDGET (panel->priv->container));
}
static void
@@ -217,6 +218,14 @@ cc_empathy_accounts_panel_init (CcEmpathyAccountsPanel *panel)
panel->priv = CC_EMPATHY_ACCOUNTS_PANEL_GET_PRIVATE (panel);
+ /* create a container widget immediately, and pack it into the panel,
+ * because the CC library expects a children to exist after
+ * the object is constructed.
+ */
+ panel->priv->container = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
+ gtk_widget_show (panel->priv->container);
+ gtk_container_add (GTK_CONTAINER (panel), panel->priv->container);
+
empathy_gtk_init ();
/* unref'd in final endpoint callbacks */