[libhandy] preferences-window: Remove subpages after they are closed



commit adccb24b4b159dde4d97a1fdcd6b6814bac31e5f
Author: Alexander Mikhaylenko <alexm gnome org>
Date:   Wed Jul 29 14:22:17 2020 +0500

    preferences-window: Remove subpages after they are closed
    
    Currently we wait until the next subpage is opened before removing the
    last one. There's no point in this, remove them immediately after they
    are hidden instead.
    
    Signed-off-by: Alexander Mikhaylenko <alexm gnome org>

 src/hdy-preferences-window.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
---
diff --git a/src/hdy-preferences-window.c b/src/hdy-preferences-window.c
index 987e8b7f..fd19f1ad 100644
--- a/src/hdy-preferences-window.c
+++ b/src/hdy-preferences-window.c
@@ -242,14 +242,14 @@ try_remove_subpages (HdyPreferencesWindow *self)
   if (hdy_deck_get_transition_running (priv->subpages_deck))
     return;
 
+  if (hdy_deck_get_visible_child (priv->subpages_deck) == priv->preferences)
+    priv->subpage = NULL;
+
   for (GList *child = gtk_container_get_children (GTK_CONTAINER (priv->subpages_deck));
        child;
        child = child->next)
     if (child->data != priv->preferences && child->data != priv->subpage)
       gtk_container_remove (GTK_CONTAINER (priv->subpages_deck), child->data);
-
-  if (hdy_deck_get_visible_child (priv->subpages_deck) == priv->preferences)
-    priv->subpage = NULL;
 }
 
 static void


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