Return an array of Space's ordered in most recently used order.
()
| 3281 | Return an array of Space's ordered in most recently used order. |
| 3282 | */ |
| 3283 | mru() { |
| 3284 | let seen = new Map(), out = []; |
| 3285 | let active = workspaceManager.get_active_workspace(); |
| 3286 | out.push(this.get(active)); |
| 3287 | seen.set(active, true); |
| 3288 | |
| 3289 | display.get_tab_list(Meta.TabList.NORMAL_ALL, null) |
| 3290 | .forEach((metaWindow, _i) => { |
| 3291 | let workspace = metaWindow.get_workspace(); |
| 3292 | if (!seen.get(workspace)) { |
| 3293 | out.push(this.get(workspace)); |
| 3294 | seen.set(workspace, true); |
| 3295 | } |
| 3296 | }); |
| 3297 | |
| 3298 | let workspaces = workspaceManager.get_n_workspaces(); |
| 3299 | for (let i = 0; i < workspaces; i++) { |
| 3300 | let workspace = workspaceManager.get_workspace_by_index(i); |
| 3301 | if (!seen.get(workspace)) { |
| 3302 | out.push(this.get(workspace)); |
| 3303 | seen.set(workspace, true); |
| 3304 | } |
| 3305 | } |
| 3306 | |
| 3307 | return out; |
| 3308 | } |
| 3309 | |
| 3310 | /** |
| 3311 | * @param display |
no outgoing calls
no test coverage detected