[gnome-shell] chrome: try find fullscreen windows only on current workspace



commit 2792ad1cf415ffabe9df89b958e65ed25cabc1a7
Author: Maxim Ermilov <zaspire rambler ru>
Date:   Tue Feb 8 04:05:30 2011 +0300

    chrome: try find fullscreen windows only on current workspace
    
    https://bugzilla.gnome.org/show_bug.cgi?id=641677

 js/ui/chrome.js    |    2 +-
 js/ui/main.js      |   11 +++++++++++
 js/ui/workspace.js |    5 ++---
 3 files changed, 14 insertions(+), 4 deletions(-)
---
diff --git a/js/ui/chrome.js b/js/ui/chrome.js
index c90390f..4fbaf8d 100644
--- a/js/ui/chrome.js
+++ b/js/ui/chrome.js
@@ -233,7 +233,7 @@ Chrome.prototype = {
     },
 
     _windowsRestacked: function() {
-        let windows = global.get_window_actors();
+        let windows = Main.getWindowActorsForWorkspace(global.screen.get_active_workspace_index());
         let primary = global.get_primary_monitor();
 
         // The chrome layer should be visible unless there is a window
diff --git a/js/ui/main.js b/js/ui/main.js
index 8f8725b..204ccd4 100644
--- a/js/ui/main.js
+++ b/js/ui/main.js
@@ -303,6 +303,17 @@ function _relayout() {
     overview.hide();
 }
 
+function isWindowActorDisplayedOnWorkspace(win, workspaceIndex) {
+    return win.get_workspace() == workspaceIndex ||
+        (win.get_meta_window() && win.get_meta_window().is_on_all_workspaces());
+}
+
+function getWindowActorsForWorkspace(workspaceIndex) {
+    return global.get_window_actors().filter(function (win) {
+        return isWindowActorDisplayedOnWorkspace(win, workspaceIndex);
+    });
+}
+
 // metacity-clutter currently uses the same prefs as plain metacity,
 // which probably means we'll be starting out with multiple workspaces;
 // remove any unused ones. (We do this from an idle handler, because
diff --git a/js/ui/workspace.js b/js/ui/workspace.js
index ebb3f1e..09faf91 100644
--- a/js/ui/workspace.js
+++ b/js/ui/workspace.js
@@ -552,7 +552,7 @@ Workspace.prototype = {
         this.actor.height = global.screen_height;
         this.scale = 1.0;
 
-        let windows = global.get_window_actors().filter(this._isMyWindow, this);
+        let windows = Main.getWindowActorsForWorkspace(this.metaWorkspace.index());
 
         // Create clones for remaining windows that should be
         // visible in the Overview
@@ -1308,8 +1308,7 @@ Workspace.prototype = {
 
     // Tests if @win belongs to this workspaces
     _isMyWindow : function (win) {
-        return win.get_workspace() == this.metaWorkspace.index() ||
-            (win.get_meta_window() && win.get_meta_window().is_on_all_workspaces());
+        return Main.isWindowActorDisplayedOnWorkspace(win, this.metaWorkspace.index());
     },
 
     // Tests if @win should be shown in the Overview



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