[AppSwitcher] Add a separator between windows in current and other workspaces.

This make it is easier for the user to figure out on which workspace the
windows are. For instance, terminals related to various activities and put on
different workspaces were previously displayed as an uniform list, with no
visible distinction between the ones from the current workspace and the others.
Now they are physically separated by a thin gray line.

This is also consistent with the way applications are displayed in the
AppSwitcher.

https://bugzilla.gnome.org/show_bug.cgi?id=597944
This commit is contained in:
Steve Frécinaux 2009-10-14 11:45:57 +02:00
parent 930a0b52f3
commit dc232d4631

View File

@ -724,7 +724,19 @@ ThumbnailList.prototype = {
_init : function(windows) { _init : function(windows) {
SwitcherList.prototype._init.call(this); SwitcherList.prototype._init.call(this);
let activeWorkspace = global.screen.get_active_workspace();
// We fake the value of "separatorAdded" when the app has no window
// on the current workspace, to avoid displaying a useless separator in
// that case.
let separatorAdded = windows.length == 0 || windows[0].get_workspace() != activeWorkspace;
for (let i = 0; i < windows.length; i++) { for (let i = 0; i < windows.length; i++) {
if (!separatorAdded && windows[i].get_workspace() != activeWorkspace) {
this.addSeparator();
separatorAdded = true;
}
let mutterWindow = windows[i].get_compositor_private(); let mutterWindow = windows[i].get_compositor_private();
let windowTexture = mutterWindow.get_texture (); let windowTexture = mutterWindow.get_texture ();
let [width, height] = windowTexture.get_size(); let [width, height] = windowTexture.get_size();