[gnome-software: 12/29] gs-shell: Drop gs_shell_is_active()




commit 78266681175579e0cace8126e71a45e15e9c8e0b
Author: Philip Withnall <pwithnall endlessos org>
Date:   Thu Jan 21 00:28:41 2021 +0000

    gs-shell: Drop gs_shell_is_active()
    
    As part of a move towards separating `GsShell` from the main application
    window, start to remove bits of its API which are window-specific.
    
    By separating `GsShell` from the main window, it can be templated using
    `GtkBuilder`, which should simplify its code significantly.
    
    Signed-off-by: Philip Withnall <pwithnall endlessos org>

 src/gs-page.c  | 3 +--
 src/gs-shell.c | 6 ------
 src/gs-shell.h | 1 -
 3 files changed, 1 insertion(+), 9 deletions(-)
---
diff --git a/src/gs-page.c b/src/gs-page.c
index f1647f098..6fd1c5e0e 100644
--- a/src/gs-page.c
+++ b/src/gs-page.c
@@ -121,7 +121,6 @@ gs_page_app_installed_cb (GObject *source,
        g_autoptr(GsPageHelper) helper = (GsPageHelper *) user_data;
        GsPluginLoader *plugin_loader = GS_PLUGIN_LOADER (source);
        GsPage *page = helper->page;
-       GsPagePrivate *priv = gs_page_get_instance_private (page);
        gboolean ret;
        g_autoptr(GError) error = NULL;
 
@@ -162,7 +161,7 @@ gs_page_app_installed_cb (GObject *source,
        /* only show this if the window is not active */
        if (gs_app_is_installed (helper->app) &&
            helper->action == GS_PLUGIN_ACTION_INSTALL &&
-           !gs_shell_is_active (priv->shell) &&
+           !gtk_window_is_active (GTK_WINDOW (gtk_widget_get_ancestor (GTK_WIDGET (helper->page), 
GTK_TYPE_WINDOW))) &&
            ((helper->interaction) & GS_SHELL_INTERACTION_NOTIFY) != 0)
                gs_app_notify_installed (helper->app);
 
diff --git a/src/gs-shell.c b/src/gs-shell.c
index f2ccae754..84b1fa26e 100644
--- a/src/gs-shell.c
+++ b/src/gs-shell.c
@@ -125,12 +125,6 @@ gs_shell_modal_dialog_present (GsShell *shell, GtkDialog *dialog)
        gtk_window_present (GTK_WINDOW (dialog));
 }
 
-gboolean
-gs_shell_is_active (GsShell *shell)
-{
-       return gtk_window_is_active (shell->main_window);
-}
-
 GtkWindow *
 gs_shell_get_window (GsShell *shell)
 {
diff --git a/src/gs-shell.h b/src/gs-shell.h
index 5cf9966c4..c81320aa0 100644
--- a/src/gs-shell.h
+++ b/src/gs-shell.h
@@ -82,7 +82,6 @@ void           gs_shell_show_uri              (GsShell        *shell,
 void            gs_shell_setup                 (GsShell        *shell,
                                                 GsPluginLoader *plugin_loader,
                                                 GCancellable   *cancellable);
-gboolean        gs_shell_is_active             (GsShell        *shell);
 GtkWindow      *gs_shell_get_window            (GsShell        *shell);
 void            gs_shell_show_notification     (GsShell        *shell,
                                                 const gchar    *title);


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