diff --git a/js/ui/dash.js b/js/ui/dash.js index 01de6af44..7e6ce1d53 100644 --- a/js/ui/dash.js +++ b/js/ui/dash.js @@ -206,7 +206,7 @@ Dash.prototype = { _redisplay: function () { this._box.hide(); - this._box.remove_all(); + this._box.destroy_children(); let favorites = AppFavorites.getAppFavorites().getFavoriteMap(); diff --git a/js/ui/endSessionDialog.js b/js/ui/endSessionDialog.js index 62b69b12b..c25633ac2 100644 --- a/js/ui/endSessionDialog.js +++ b/js/ui/endSessionDialog.js @@ -470,7 +470,7 @@ EndSessionDialog.prototype = { OpenAsync: function(type, timestamp, totalSecondsToStayOpen, inhibitorObjectPaths, callback) { this._totalSecondsToStayOpen = totalSecondsToStayOpen; this._inhibitors = []; - this._applicationList.remove_all(); + this._applicationList.destroy_children(); this._type = type; if (!(this._type in DialogContent)) diff --git a/js/ui/modalDialog.js b/js/ui/modalDialog.js index 7b3f0d36f..fee62662a 100644 --- a/js/ui/modalDialog.js +++ b/js/ui/modalDialog.js @@ -83,7 +83,7 @@ ModalDialog.prototype = { }, setButtons: function(buttons) { - this._buttonLayout.remove_all(); + this._buttonLayout.destroy_children(); let i = 0; for (let index in buttons) { let buttonInfo = buttons[index]; diff --git a/js/ui/workspacesView.js b/js/ui/workspacesView.js index f53db7aea..2a6557b47 100644 --- a/js/ui/workspacesView.js +++ b/js/ui/workspacesView.js @@ -769,7 +769,7 @@ WorkspaceIndicatorPanel.prototype = { else this.actor.set_skip_paint(this._box, false); - this._box.remove_all(); + this._box.destroy_children(); for (let i = 0; i < this._workspaces.length; i++) { let actor = new St.Button({ style_class: 'workspace-indicator', track_hover: true }); diff --git a/src/st/st-container.c b/src/st/st-container.c index 0fb5eb462..2f7d095b1 100644 --- a/src/st/st-container.c +++ b/src/st/st-container.c @@ -35,6 +35,7 @@ struct _StContainerPrivate GList *children; ClutterActor *first_child; ClutterActor *last_child; + gboolean block_update_pseude_classes; }; static void clutter_container_iface_init (ClutterContainerIface *iface); @@ -50,6 +51,9 @@ st_container_update_pseudo_classes (StContainer *container) ClutterActor *first_child, *last_child; StContainerPrivate *priv = container->priv; + if (priv->block_update_pseude_classes) + return; + first_item = priv->children; first_child = first_item ? first_item->data : NULL; if (first_child != priv->first_child) @@ -91,28 +95,6 @@ st_container_update_pseudo_classes (StContainer *container) } } -/** - * st_container_remove_all: - * @container: An #StContainer - * - * Removes all child actors from @container. - */ -void -st_container_remove_all (StContainer *container) -{ - StContainerPrivate *priv = container->priv; - - /* copied from clutter_group_remove_all() */ - while (priv->children) - { - ClutterActor *child = priv->children->data; - priv->children = priv->children->next; - - clutter_container_remove_actor (CLUTTER_CONTAINER (container), child); - } - st_container_update_pseudo_classes (container); -} - /** * st_container_destroy_children: * @container: An #StContainer @@ -124,13 +106,14 @@ st_container_destroy_children (StContainer *container) { StContainerPrivate *priv = container->priv; - while (priv->children) - { - ClutterActor *child = priv->children->data; - priv->children = priv->children->next; + priv->block_update_pseude_classes = TRUE; - clutter_actor_destroy (child); - } + while (priv->children) + clutter_actor_destroy (priv->children->data); + + priv->block_update_pseude_classes = FALSE; + + st_container_update_pseudo_classes (container); } void diff --git a/src/st/st-container.h b/src/st/st-container.h index 91f457f26..023bef921 100644 --- a/src/st/st-container.h +++ b/src/st/st-container.h @@ -53,7 +53,6 @@ struct _StContainerClass { GType st_container_get_type (void) G_GNUC_CONST; -void st_container_remove_all (StContainer *container); void st_container_destroy_children (StContainer *container); GList * st_container_get_focus_chain (StContainer *container);