()
| 150 | workspaceSettings = new WorkspaceSettings(extension); |
| 151 | spaces = new Spaces(); |
| 152 | let initWorkspaces = () => { |
| 153 | try { |
| 154 | spaces.init(); |
| 155 | } catch (e) { |
| 156 | console.error(e); |
| 157 | } |
| 158 | |
| 159 | // Fix the stack overlay |
| 160 | spaces.mru().reverse().forEach(s => { |
| 161 | // if s.selectedWindow exists and is in view, then use option moveto: false |
| 162 | if (s.selectedWindow) { |
| 163 | let options = s.isFullyVisible(s.selectedWindow) ? { moveto: false } : { force: true }; |
| 164 | ensureViewport(s.selectedWindow, s, options); |
| 165 | } |
| 166 | s.monitor.clickOverlay.show(); |
| 167 | }); |
| 168 | Topbar.fixTopBar(); |
| 169 | |
| 170 | // on idle update space topbar elements and name |
| 171 | Utils.later_add(Meta.LaterType.IDLE, () => { |
| 172 | spaces.forEach(s => { |
| 173 | s.setSpaceTopbarElementsVisible(); |
| 174 | s.updateName(); |
| 175 | |
| 176 | /** |
| 177 | * The below resolves https://github.com/paperwm/PaperWM/issues/758. |
| 178 | */ |
| 179 | const x = s.cloneContainer.x; |
| 180 | s.viewportMoveToX(0); |
| 181 | s.viewportMoveToX(x); |
| 182 | }); |
| 183 | }); |
| 184 | }; |
| 185 | |
| 186 | if (Main.layoutManager._startingUp) { |
| 187 | // Defer workspace initialization until existing windows are accessible. |
nothing calls this directly
no test coverage detected