diff options
author | Pablo Barciela <[email protected]> | 2019-08-18 02:22:52 +0200 |
---|---|---|
committer | raveit65 <[email protected]> | 2022-07-20 21:40:41 +0200 |
commit | 402829c588dbdb4b47199e9a6aa637dfac29dee1 (patch) | |
tree | 395107f1389c53337fff5ed9b4b91e154510798b /libcaja-private/caja-progress-info.c | |
parent | 38d1e55da484c6eb47bf1a4dbd1952e46910a3a6 (diff) | |
download | caja-402829c588dbdb4b47199e9a6aa637dfac29dee1.tar.bz2 caja-402829c588dbdb4b47199e9a6aa637dfac29dee1.tar.xz |
caja-progress-info: use NotifyNotification instead of GNotification
Fixes https://github.com/mate-desktop/caja/issues/1285
Diffstat (limited to 'libcaja-private/caja-progress-info.c')
-rw-r--r-- | libcaja-private/caja-progress-info.c | 26 |
1 files changed, 12 insertions, 14 deletions
diff --git a/libcaja-private/caja-progress-info.c b/libcaja-private/caja-progress-info.c index e72cac40..f749715f 100644 --- a/libcaja-private/caja-progress-info.c +++ b/libcaja-private/caja-progress-info.c @@ -26,6 +26,7 @@ #include <math.h> #include <string.h> +#include <libnotify/notify.h> #include <glib/gi18n.h> #include <gtk/gtk.h> @@ -603,19 +604,8 @@ update_status_icon_and_window (void) { char *tooltip; gboolean toshow; - GNotification *notification; - gboolean show_notifications = g_settings_get_boolean (caja_preferences, CAJA_PREFERENCES_SHOW_NOTIFICATIONS); static gboolean window_shown = FALSE; - if (show_notifications) - { - GIcon *icon; - - notification = g_notification_new ("caja"); - icon = g_themed_icon_new ("system-file-manager"); - g_notification_set_icon (notification, icon); - } - tooltip = g_strdup_printf (ngettext ("%'d file operation active", "%'d file operations active", n_progress_ops), @@ -632,10 +622,18 @@ update_status_icon_and_window (void) if (window_shown) { - if (show_notifications && !gtk_window_is_active (GTK_WINDOW (get_progress_window ()))) + if (g_settings_get_boolean (caja_preferences, CAJA_PREFERENCES_SHOW_NOTIFICATIONS) && + !gtk_window_is_active (GTK_WINDOW (get_progress_window ()))) { - g_notification_set_body (notification, _("Process completed")); - g_application_send_notification (g_application_get_default (), "caja", notification); + NotifyNotification *notification; + + notification = notify_notification_new ("caja", + _("Process completed"), + "system-file-manager"); + + notify_notification_show (notification, NULL); + + g_object_unref (notification); } gtk_widget_hide (get_progress_window ()); |