MCPcopy
hub / github.com/paperwm/PaperWM / initWorkspaces

Function initWorkspaces

tiling.js:152–184  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

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.

Callers

nothing calls this directly

Calls 8

ensureViewportFunction · 0.85
mruMethod · 0.80
isFullyVisibleMethod · 0.80
updateNameMethod · 0.80
viewportMoveToXMethod · 0.80
initMethod · 0.45
showMethod · 0.45

Tested by

no test coverage detected