diff --git a/js/ui/altTab.js b/js/ui/altTab.js index da4c99641..a1a5f1612 100644 --- a/js/ui/altTab.js +++ b/js/ui/altTab.js @@ -724,7 +724,19 @@ ThumbnailList.prototype = { _init : function(windows) { 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++) { + if (!separatorAdded && windows[i].get_workspace() != activeWorkspace) { + this.addSeparator(); + separatorAdded = true; + } + let mutterWindow = windows[i].get_compositor_private(); let windowTexture = mutterWindow.get_texture (); let [width, height] = windowTexture.get_size();