From f139f34c514baa09100f3fd9ad556428c7d33e6f Mon Sep 17 00:00:00 2001 From: Logan Rathbone Date: Tue, 11 Jan 2022 23:39:40 -0500 Subject: help/docs: update; notification: bugfixes. --- src/notification.c | 14 +++++++++++--- src/option.c | 4 ++-- 2 files changed, 13 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/notification.c b/src/notification.c index 78f26c2..75c3035 100644 --- a/src/notification.c +++ b/src/notification.c @@ -77,10 +77,16 @@ zenity_notification_new (char *message, char *icon_path) if (g_file_query_exists (icon_file, NULL)) { icon = g_file_icon_new (icon_file); - g_notification_set_icon (notif, icon); } else - g_printerr (_("Icon file not found: %s\n"), icon_path); + { + g_debug (_("Icon filename %s not found; trying theme icon."), + icon_path); + icon = g_themed_icon_new_with_default_fallbacks (icon_path); +// icon = g_themed_icon_new (icon_path); + } + + g_notification_set_icon (notif, icon); } return g_steal_pointer (¬if); @@ -102,7 +108,7 @@ static gboolean zenity_notification_handle_stdin (GIOChannel *channel, GIOCondition condition, gpointer user_data) { - g_autofree char *icon_file = NULL; + static char *icon_file; if ((condition & G_IO_IN) != 0) { @@ -157,6 +163,7 @@ zenity_notification_handle_stdin (GIOChannel *channel, GIOCondition condition, if (! g_ascii_strcasecmp (command, "icon")) { + g_free (icon_file); icon_file = g_strdup (value); } else if (!g_ascii_strcasecmp (command, "message")) @@ -171,6 +178,7 @@ zenity_notification_handle_stdin (GIOChannel *channel, GIOCondition condition, g_autoptr(GNotification) notif = NULL; notif = zenity_notification_new (value, icon_file); + if (notif == NULL) continue; diff --git a/src/option.c b/src/option.c index 0daa493..5da6a8f 100644 --- a/src/option.c +++ b/src/option.c @@ -2006,8 +2006,8 @@ zenity_create_context (void) /* Adds notification option entries */ a_group = g_option_group_new ("notification", - N_ ("Notification icon options"), - N_ ("Show notification icon options"), + N_ ("Notification options"), + N_ ("Show notification options"), NULL, NULL); g_option_group_add_entries (a_group, notification_options); -- cgit v1.2.1