[totem] main: Fix lost switcher widget



commit cdf0736a671ccf3307fcc5974be445bac6240545
Author: Bastien Nocera <hadess hadess net>
Date:   Sat Feb 1 13:26:15 2014 +0100

    main: Fix lost switcher widget
    
    Prevent totem_object_set_main_page() from being called
    multiple times with the same value. This avoids us losing the
    switcher widget. Oopsie.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=723383

 src/totem-object.c |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)
---
diff --git a/src/totem-object.c b/src/totem-object.c
index 99cf968..6104979 100644
--- a/src/totem-object.c
+++ b/src/totem-object.c
@@ -871,6 +871,11 @@ void
 totem_object_set_main_page (TotemObject *totem,
                            const char  *page_id)
 {
+       if (g_strcmp0 (page_id, gtk_stack_get_visible_child_name (GTK_STACK (totem->stack))) == 0)
+               return;
+
+       gtk_stack_set_visible_child_full (GTK_STACK (totem->stack), page_id, GTK_STACK_TRANSITION_TYPE_NONE);
+
        if (g_strcmp0 (page_id, "player") == 0) {
                g_object_get (totem->header,
                              "title", &totem->title,
@@ -910,7 +915,6 @@ totem_object_set_main_page (TotemObject *totem,
                gtk_widget_hide (totem->fullscreen_button);
                gtk_widget_hide (totem->gear_button);
        }
-       gtk_stack_set_visible_child_full (GTK_STACK (totem->stack), page_id, GTK_STACK_TRANSITION_TYPE_NONE);
 }
 
 /**


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