[Xfce4-commits] [apps/xfce4-notifyd] 01/01: Fix empty body when markup is invalid (Bug #10027)

noreply at xfce.org noreply at xfce.org
Mon Aug 14 23:20:57 CEST 2017


This is an automated email from the git hooks/post-receive script.

o   c   h   o   s   i       p   u   s   h   e   d       a       c   o   m   m   i   t       t   o       b   r   a   n   c   h       m   a   s   t   e   r   
   in repository apps/xfce4-notifyd.

commit 8265b411339a390768f2c94f2bc2e0f9983da04b
Author: Simon Steinbeiss <simon.steinbeiss at elfenbeinturm.at>
Date:   Mon Aug 14 23:18:00 2017 +0200

    Fix empty body when markup is invalid (Bug #10027)
    
    This patch was borrowed from Gnome's notification daemon:
    https://github.com/GNOME/notification-daemon/commit/620c53fc9cec4ac4ed79754c71429be9db4a7a77
---
 xfce4-notifyd/xfce-notify-window.c | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/xfce4-notifyd/xfce-notify-window.c b/xfce4-notifyd/xfce-notify-window.c
index 7671f3d..f46577e 100644
--- a/xfce4-notifyd/xfce-notify-window.c
+++ b/xfce4-notifyd/xfce-notify-window.c
@@ -728,7 +728,15 @@ xfce_notify_window_set_body(XfceNotifyWindow *window,
     g_return_if_fail(XFCE_IS_NOTIFY_WINDOW(window));
 
     if(body && *body) {
-        gtk_label_set_markup(GTK_LABEL(window->body), body);
+        if (pango_parse_markup (body, -1, 0, NULL, NULL, NULL, NULL)) {
+            gtk_label_set_markup (GTK_LABEL (window->body), body);
+        } else {
+            gchar *tmp;
+
+            tmp = g_markup_escape_text (body, -1);
+            gtk_label_set_text (GTK_LABEL (window->body), body);
+            g_free (tmp);
+        }
         gtk_widget_show(window->body);
 
         window->has_body_text = TRUE;

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Xfce4-commits mailing list