[Xfce4-commits] [apps/xfce4-notifyd] 01/01: Support image-path hint of the fd.o spec (Bug #7846)

noreply at xfce.org noreply at xfce.org
Fri Sep 30 22:25:57 CEST 2016


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

ochosi pushed a commit to branch master
in repository apps/xfce4-notifyd.

commit 806524033f39bcb8444a5aa7b2a6f9ea323317ed
Author: Simon Steinbeiss <simon.steinbeiss at elfenbeinturm.at>
Date:   Fri Sep 30 22:25:06 2016 +0200

    Support image-path hint of the fd.o spec (Bug #7846)
---
 xfce4-notifyd/xfce-notify-daemon.c | 16 +++++++++++++---
 1 file changed, 13 insertions(+), 3 deletions(-)

diff --git a/xfce4-notifyd/xfce-notify-daemon.c b/xfce4-notifyd/xfce-notify-daemon.c
index 6307490..a264cd3 100644
--- a/xfce4-notifyd/xfce-notify-daemon.c
+++ b/xfce4-notifyd/xfce-notify-daemon.c
@@ -1044,6 +1044,7 @@ static gboolean notify_notify (XfceNotifyGBus *skeleton,
     XfceNotifyWindow *window;
     GdkPixbuf *pix = NULL;
     GVariant *image_data = NULL;
+    const gchar *image_path = NULL;
     const gchar *desktop_id = NULL;
     gint value_hint = 0;
     gboolean value_hint_set = FALSE;
@@ -1080,6 +1081,11 @@ static gboolean notify_notify (XfceNotifyGBus *skeleton,
         {
             image_data = value;
         }
+        else if ((g_strcmp0 (key, "image-path") == 0) ||
+                 (g_strcmp0 (key, "image_path") == 0))
+        {
+            image_path = g_variant_get_string (value, NULL);
+        }
         else if ((g_strcmp0 (key, "desktop_entry") == 0) ||
                  (g_strcmp0 (key, "desktop-entry") == 0))
         {
@@ -1147,15 +1153,19 @@ static gboolean notify_notify (XfceNotifyGBus *skeleton,
         g_idle_add(notify_show_window, window);
     }
 
-    if(!app_icon || !*app_icon) {
-        if(image_data) {
+    if (!app_icon || !*app_icon) {
+        if (image_data) {
             pix = notify_pixbuf_from_image_data(image_data);
             if(pix) {
                 xfce_notify_window_set_icon_pixbuf(window, pix);
                 g_object_unref(G_OBJECT(pix));
             }
             g_variant_unref(image_data);
-        } else {
+        }
+        else if (image_path) {
+            xfce_notify_window_set_icon_name (window, image_path);
+        }
+        else {
             if(desktop_id) {
                 gchar *resource = g_strdup_printf("applications%c%s.desktop",
                                                   G_DIR_SEPARATOR,

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


More information about the Xfce4-commits mailing list