[gnome-software] details: Avoid refreshing the page when it's not visible



commit 8dc6f50d37295427c9b690ed46a4435985d411f5
Author: Kalev Lember <kalevlember gmail com>
Date:   Mon Sep 15 23:12:18 2014 +0200

    details: Avoid refreshing the page when it's not visible
    
    This makes sure that we don't call switch_to(details) in response to app
    state changes when the user is actually no longer on the page.

 src/gs-shell-details.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)
---
diff --git a/src/gs-shell-details.c b/src/gs-shell-details.c
index f7140f3..2cf22bc 100644
--- a/src/gs-shell-details.c
+++ b/src/gs-shell-details.c
@@ -276,8 +276,10 @@ static gboolean
 gs_shell_details_switch_to_idle (gpointer user_data)
 {
        GsShellDetails *shell_details = GS_SHELL_DETAILS (user_data);
+       GsShellDetailsPrivate *priv = shell_details->priv;
 
-       gs_shell_details_switch_to (shell_details);
+       if (gs_shell_get_mode (priv->shell) == GS_SHELL_MODE_DETAILS)
+               gs_shell_details_switch_to (shell_details);
 
        g_object_unref (shell_details);
        return G_SOURCE_REMOVE;


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