[gnome-software/859-app-has-been-installed-notifications-sit-around-indefinitely: 112/116] gs-application: Remove possibly obsolete notification on start




commit 210172058fb25f6b6d0c7980bf3bdf6ba10a1a50
Author: Milan Crha <mcrha redhat com>
Date:   Wed May 25 19:29:00 2022 +0200

    gs-application: Remove possibly obsolete notification on start
    
    Remove all possibly obsolete notifications on the application start.
    This works for desktop environments which use persistent notifications
    and the user did not close the notification yet.

 src/gs-application.c | 14 ++++++++++++--
 1 file changed, 12 insertions(+), 2 deletions(-)
---
diff --git a/src/gs-application.c b/src/gs-application.c
index e3f5f55c7..e449afeb7 100644
--- a/src/gs-application.c
+++ b/src/gs-application.c
@@ -148,8 +148,18 @@ gs_application_init (GsApplication *application)
                  _("Show version number"), NULL },
                { NULL }
        };
-
-       g_application_add_main_option_entries (G_APPLICATION (application), options);
+       GApplication *gapp = G_APPLICATION (application);
+
+       g_application_add_main_option_entries (gapp, options);
+
+       /* Remove possibly obsolete notifications */
+       g_application_withdraw_notification (gapp, "installed");
+       g_application_withdraw_notification (gapp, "restart-required");
+       g_application_withdraw_notification (gapp, "updates-available");
+       g_application_withdraw_notification (gapp, "updates-installed");
+       g_application_withdraw_notification (gapp, "upgrades-available");
+       g_application_withdraw_notification (gapp, "offline-updates");
+       g_application_withdraw_notification (gapp, "eol");
 }
 
 static gboolean


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]