summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorLogan Rathbone <poprocks@gmail.com>2022-01-11 23:39:40 -0500
committerLogan Rathbone <poprocks@gmail.com>2022-01-11 23:39:40 -0500
commitf139f34c514baa09100f3fd9ad556428c7d33e6f (patch)
tree8c6426934cfcbfd56408fe859ba4a77474b0e3eb /src
parent2b75b2f9a11fabff670e15139bba4b781362eca1 (diff)
downloadzenity-f139f34c514baa09100f3fd9ad556428c7d33e6f.tar.gz
help/docs: update; notification: bugfixes.
Diffstat (limited to 'src')
-rw-r--r--src/notification.c14
-rw-r--r--src/option.c4
2 files changed, 13 insertions, 5 deletions
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 (&notif);
@@ -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);