[gnome-initial-setup] cc-notebook: Handle visibility management ourselves



commit 9fa4cb44735f428012741344b41871f556f1cba7
Author: Jasper St. Pierre <jstpierre mecheye net>
Date:   Wed Nov 14 12:49:17 2012 -0500

    cc-notebook: Handle visibility management ourselves
    
    Clutter's current visibility API is the worst of both worlds, something
    that tries to be smart behind your back that rarely does what you want,
    except in simple cases. If we don't do this, we'll end up automatically
    showing every page we add, which goes against the whole "hide pages to
    skip them" act.

 gnome-initial-setup/cc-notebook.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)
---
diff --git a/gnome-initial-setup/cc-notebook.c b/gnome-initial-setup/cc-notebook.c
index 0cfbaf2..e6f830c 100644
--- a/gnome-initial-setup/cc-notebook.c
+++ b/gnome-initial-setup/cc-notebook.c
@@ -467,11 +467,14 @@ cc_notebook_add_page (CcNotebook *self,
                                                                          CLUTTER_BIN_ALIGNMENT_FILL));
 
         embed = gtk_clutter_actor_new_with_contents (widget);
+        g_object_set (embed, "show-on-set-parent", FALSE, NULL);
         g_object_set_data (G_OBJECT (widget), "cc-notebook-frame", frame);
         g_object_set_data (G_OBJECT (widget), "cc-notebook", self);
         g_signal_connect (widget, "destroy", G_CALLBACK (widget_destroyed), NULL);
         clutter_actor_add_child (frame, embed);
-        gtk_widget_show (widget);
+
+        if (gtk_widget_get_visible (widget))
+                clutter_actor_show (embed);
 
         res = clutter_actor_get_n_children (self->priv->bin);
         clutter_actor_insert_child_at_index (self->priv->bin, frame, res);



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