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



commit 195c8955d1e703fd3d3b085b110f8d1dbf8948f5
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 4188446..f10d4fa 100644
--- a/src/gs-shell-details.c
+++ b/src/gs-shell-details.c
@@ -1630,6 +1630,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 a991c85..bb5104d 100644
--- a/src/gs-shell.c
+++ b/src/gs-shell.c
@@ -620,6 +620,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]