[gnome-shell/wip/new-notifications: 1/17] Remove use of superfluous MetaWindowActor APIs



commit 316b35dc946b8011f455d701e987da6438f43e3b
Author: Jasper St. Pierre <jstpierre mecheye net>
Date:   Mon Nov 4 21:24:27 2013 -0500

    Remove use of superfluous MetaWindowActor APIs

 js/ui/windowManager.js |   41 +++++++++++++++++++++++------------------
 js/ui/xdndHandler.js   |    2 +-
 2 files changed, 24 insertions(+), 19 deletions(-)
---
diff --git a/js/ui/windowManager.js b/js/ui/windowManager.js
index 75be4c5..cf23663 100644
--- a/js/ui/windowManager.js
+++ b/js/ui/windowManager.js
@@ -232,12 +232,13 @@ const WorkspaceTracker = new Lang.Class({
 
         let windows = global.get_window_actors();
         for (i = 0; i < windows.length; i++) {
-            let win = windows[i];
+            let actor = windows[i];
+            let win = actor.get_meta_window();
 
-            if (win.get_meta_window().is_on_all_workspaces())
+            if (win.is_on_all_workspaces())
                 continue;
 
-            let workspaceIndex = win.get_workspace();
+            let workspaceIndex = win.get_workspace().index();
             emptyWorkspaces[workspaceIndex] = false;
         }
 
@@ -975,25 +976,29 @@ const WindowManager = new Lang.Class({
         wgroup.add_actor(switchData.movingWindowBin);
 
         for (let i = 0; i < windows.length; i++) {
-            let window = windows[i];
+            let actor = windows[i];
+            let window = actor.get_meta_window();
 
-            if (!window.meta_window.showing_on_its_workspace())
+            if (!window.showing_on_its_workspace())
                 continue;
 
-            if (this._movingWindow && window.meta_window == this._movingWindow) {
-                switchData.movingWindow = { window: window,
-                                            parent: window.get_parent() };
+            if (window.is_on_all_workspaces())
+                continue;
+
+            let record = { window: actor,
+                           parent: actor.get_parent() };
+
+            if (this._movingWindow && window == this._movingWindow) {
+                switchData.movingWindow = record;
                 switchData.windows.push(switchData.movingWindow);
-                window.reparent(switchData.movingWindowBin);
-            } else if (window.get_workspace() == from) {
-                switchData.windows.push({ window: window,
-                                          parent: window.get_parent() });
-                window.reparent(switchData.outGroup);
-            } else if (window.get_workspace() == to) {
-                switchData.windows.push({ window: window,
-                                          parent: window.get_parent() });
-                window.reparent(switchData.inGroup);
-                window.show();
+                actor.reparent(switchData.movingWindowBin);
+            } else if (window.get_workspace().index() == from) {
+                switchData.windows.push(record);
+                actor.reparent(switchData.outGroup);
+            } else if (window.get_workspace().index() == to) {
+                switchData.windows.push(record);
+                actor.reparent(switchData.inGroup);
+                actor.show();
             }
         }
 
diff --git a/js/ui/xdndHandler.js b/js/ui/xdndHandler.js
index da6c18f..b132d20 100644
--- a/js/ui/xdndHandler.js
+++ b/js/ui/xdndHandler.js
@@ -62,7 +62,7 @@ const XdndHandler = new Lang.Class({
             let cursorWindow = windows[windows.length - 1];
 
             // FIXME: more reliable way?
-            if (!cursorWindow.is_override_redirect())
+            if (!cursorWindow.get_meta_window().is_override_redirect())
                 return;
 
             let constraint_position = new Clutter.BindConstraint({ coordinate : 
Clutter.BindCoordinate.POSITION,


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