[gnome-shell] layout: Allow adding already parented actors for chrome tracking



commit 74bd009c86a2c8ca765d8d772a312fe0eec8abb2
Author: Carlos Garnacho <carlosg gnome org>
Date:   Fri Jul 14 22:23:53 2017 +0200

    layout: Allow adding already parented actors for chrome tracking
    
    let trackChrome accept actors that are not children of chrome actors.
    this will be useful for the MetaCloseDialog in gnome-shell, which
    is already included in the MetaWindowGroup, but needs to be tracked
    as chrome for the dialog to receive pointer events on X11.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=762083

 js/ui/layout.js |    8 +++-----
 1 files changed, 3 insertions(+), 5 deletions(-)
---
diff --git a/js/ui/layout.js b/js/ui/layout.js
index 4c11e1d..ebf09c2 100644
--- a/js/ui/layout.js
+++ b/js/ui/layout.js
@@ -769,8 +769,7 @@ const LayoutManager = new Lang.Class({
     // @actor: a descendant of the chrome to begin tracking
     // @params: parameters describing how to track @actor
     //
-    // Tells the chrome to track @actor, which must be a descendant
-    // of an actor added via addChrome(). This can be used to extend the
+    // Tells the chrome to track @actor. This can be used to extend the
     // struts or input region to cover specific children.
     //
     // @params can have any of the same values as in addChrome(),
@@ -783,10 +782,9 @@ const LayoutManager = new Lang.Class({
             ancestor = ancestor.get_parent();
             index = this._findActor(ancestor);
         }
-        if (!ancestor)
-            throw new Error('actor is not a descendent of a chrome actor');
 
-        let ancestorData = this._trackedActors[index];
+        let ancestorData = ancestor ? this._trackedActors[index]
+                                    : defaultParams;
         if (!params)
             params = {};
         // We can't use Params.parse here because we want to drop


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