From 6af271817afd4411a2d560eded80252c27db8452 Mon Sep 17 00:00:00 2001 From: Romain B Date: Fri, 1 Dec 2017 17:35:13 +0100 Subject: [PATCH] This allows to properly show some characters, such as ampersand. - This fix xfce_dialog_show_warning, xfce_dialog_show_info, xfce_dialog_show_info - Broken since gtk3 - Fix bug #12715 --- libxfce4ui/xfce-dialogs.c | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/libxfce4ui/xfce-dialogs.c b/libxfce4ui/xfce-dialogs.c index cf402f9..453f64d 100644 --- a/libxfce4ui/xfce-dialogs.c +++ b/libxfce4ui/xfce-dialogs.c @@ -940,7 +940,19 @@ xfce_message_dialog (GtkWindow *parent, g_return_val_if_fail (parent == NULL || GTK_IS_WINDOW (parent), 0); va_start (args, first_button_text); - dialog = xfce_message_dialog_new_valist (parent, title, stock_id, primary_text, + +#if GTK_CHECK_VERSION (3, 0, 0) + gchar *escaped_text; + /* escape ampersand symbols, etc. (bug #12715) */ + escaped_text = g_markup_escape_text (primary_text, -1); +#endif + + dialog = xfce_message_dialog_new_valist (parent, title, stock_id, +#if GTK_CHECK_VERSION (3, 0, 0) + escaped_text, +#else + primary_text, +#endif secondary_text, first_button_text, args); va_end (args); @@ -948,6 +960,10 @@ xfce_message_dialog (GtkWindow *parent, gtk_widget_destroy (dialog); +#if GTK_CHECK_VERSION (3, 0, 0) + g_free(escaped_text); +#endif + return response_id; } -- 2.15.0