[gnome-shell] Fix Chrome.removeActor()



commit 5a0d8eca9ffb834760a7f87efeed576c15630049
Author: Dan Winship <danw gnome org>
Date:   Tue Jun 30 14:57:40 2009 -0400

    Fix Chrome.removeActor()
    
    The split between this.actor and this.nonOverlayActor in chrome.js is
    annoying, but aside from actually subclassing ClutterGroup (which
    would have to be done from C), all of the other possibilities are
    annoying too.

 js/ui/chrome.js |   16 +++++++++-------
 1 files changed, 9 insertions(+), 7 deletions(-)
---
diff --git a/js/ui/chrome.js b/js/ui/chrome.js
index 59e5415..b829ed5 100644
--- a/js/ui/chrome.js
+++ b/js/ui/chrome.js
@@ -126,9 +126,11 @@ Chrome.prototype = {
     //
     // Removes @actor from the chrome layer
     removeActor: function(actor) {
-        this.actor.remove_actor(actor);
-        // We don't have to do anything else; the parent-set handlers
-        // will do the rest.
+        if (actor.get_parent() == this.nonOverlayActor)
+            this.nonOverlayActor.remove_actor(actor);
+        else
+            this.actor.remove_actor(actor);
+        this._untrackActor(actor, true, true);
     },
 
     _findActor: function(actor) {
@@ -170,7 +172,7 @@ Chrome.prototype = {
         this._trackedActors.push(actorData);
 
         actor = actor.get_parent();
-        if (actor != this.actor)
+        if (actor != this.actor && actor != this.nonOverlayActor)
             this._trackActor(actor, false, false);
 
         if (inputRegion || strut)
@@ -198,7 +200,7 @@ Chrome.prototype = {
             actor.disconnect(actorData.parentSetId);
 
             actor = actor.get_parent();
-            if (actor && actor != this.actor)
+            if (actor && actor != this.actor && actor != this.nonOverlayActor)
                 this._untrackActor(actor, false, false);
         }
 
@@ -209,10 +211,10 @@ Chrome.prototype = {
     _actorReparented: function(actor, oldParent) {
         if (this._verifyAncestry(actor, this.actor)) {
             let newParent = actor.get_parent();
-            if (newParent != this.actor)
+            if (newParent != this.actor && newParent != this.nonOverlayActor)
                 this._trackActor(newParent, false, false);
         }
-        if (oldParent != this.actor)
+        if (oldParent != this.actor && oldParent != this.nonOverlayActor)
             this._untrackActor(oldParent, false, false);
     },
 



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