diff --git a/libedataserverui/e-source-selector-dialog.c b/libedataserverui/e-source-selector-dialog.c
index 5082170..85d89d6 100644
--- a/libedataserverui/e-source-selector-dialog.c
+++ b/libedataserverui/e-source-selector-dialog.c
@@ -88,6 +88,7 @@ e_source_selector_dialog_init (ESourceSelectorDialog *dialog)
 	ESourceSelectorDialogPrivate *priv;
 	GtkWidget *action_area;
 	GtkWidget *content_area;
+	GtkStyleContext *context;
 
 	priv = g_new0 (ESourceSelectorDialogPrivate, 1);
 	priv->selected_source = NULL;
@@ -102,7 +103,7 @@ e_source_selector_dialog_init (ESourceSelectorDialog *dialog)
 #if !GTK_CHECK_VERSION(2,90,7)
 	g_object_set (dialog, "has-separator", FALSE, NULL);
 #endif
-	gtk_widget_ensure_style (GTK_WIDGET (dialog));
+	context = gtk_widget_get_style_context (GTK_WIDGET (dialog));
 	gtk_container_set_border_width (GTK_CONTAINER (content_area), 0);
 	gtk_container_set_border_width (GTK_CONTAINER (action_area), 12);
 	gtk_dialog_add_buttons (GTK_DIALOG (dialog),
