[gnome-software] Hide some notifications when the app is launched or the window is closed



commit b99dff275891e9c436434c6a6e5cd73e843a6d9d
Author: Richard Hughes <richard hughsie com>
Date:   Wed Dec 14 13:45:46 2016 +0000

    Hide some notifications when the app is launched or the window is closed
    
    Fixes: https://bugzilla.gnome.org/show_bug.cgi?id=775885

 src/gs-shell-details.c |    5 +++++
 src/gs-shell.c         |    6 ++++++
 2 files changed, 11 insertions(+), 0 deletions(-)
---
diff --git a/src/gs-shell-details.c b/src/gs-shell-details.c
index a21f28f..91c205c 100644
--- a/src/gs-shell-details.c
+++ b/src/gs-shell-details.c
@@ -1693,6 +1693,11 @@ static void
 gs_shell_details_app_launch_button_cb (GtkWidget *widget, GsShellDetails *self)
 {
        g_autoptr(GCancellable) cancellable = g_cancellable_new ();
+
+       /* hide the notification */
+       g_application_withdraw_notification (g_application_get_default (),
+                                            "installed");
+
        g_set_object (&self->cancellable, cancellable);
        gs_page_launch_app (GS_PAGE (self), self->app, self->cancellable);
 }
diff --git a/src/gs-shell.c b/src/gs-shell.c
index 148c617..144691d 100644
--- a/src/gs-shell.c
+++ b/src/gs-shell.c
@@ -685,6 +685,12 @@ main_window_closed_cb (GtkWidget *dialog, GdkEvent *event, gpointer user_data)
        GsShell *shell = user_data;
        GsShellPrivate *priv = gs_shell_get_instance_private (shell);
 
+       /* hide any notifications */
+       g_application_withdraw_notification (g_application_get_default (),
+                                            "installed");
+       g_application_withdraw_notification (g_application_get_default (),
+                                            "install-resources");
+
        /* When the window is closed, reset the initial mode to overview */
        priv->mode = GS_SHELL_MODE_OVERVIEW;
 


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