MCPcopy Index your code
hub / github.com/paperwm/PaperWM / constructor

Method constructor

tiling.js:255–382  ·  view source on GitHub ↗
(workspace, container, doInit)

Source from the content-addressed store, hash-verified

253 background;
254
255 constructor(workspace, container, doInit) {
256 super(0);
257 this.workspace = workspace;
258 this.signals = new Utils.Signals();
259
260 // windows that should be represented by their WindowActor
261 this.visible = [];
262 this._floating = [];
263 this._populated = false;
264
265 // default focusMode (can be overriden by saved user pref in Space.init method)
266 this.focusMode = FocusModes.DEFAULT;
267 this.focusModeIcon = new Topbar.FocusIcon({
268 name: 'panel',
269 style_class: 'space-focus-mode-icon',
270 })
271 .setClickFunction(() => {
272 switchToNextFocusMode(this);
273 })
274 .setVisible(false); // hide by default
275 this.unfocusXPosition = null; // init
276
277 let clip = new Clutter.Actor({ name: "clip" });
278 this.clip = clip;
279 let actor = new Clutter.Actor({ name: "space-actor" });
280 actor.set_pivot_point(0.5, 0);
281
282 this._visible = true;
283 this.hide(); // We keep the space actor hidden when inactive due to performance
284
285 this.actor = actor;
286 let cloneClip = new Clutter.Actor({ name: "clone-clip" });
287 this.cloneClip = cloneClip;
288 let cloneContainer = new St.Widget({ name: "clone-container" });
289 this.cloneContainer = cloneContainer;
290
291 const workspaceIndicator = new St.Widget({
292 reactive: true,
293 name: 'panel',
294 style_class: 'space-workspace-indicator',
295 });
296 signals.connect(workspaceIndicator, 'button-press-event', () => Main.overview.toggle());
297 signals.connect(workspaceIndicator, 'scroll-event', (_actor, event) => {
298 const direction = event.get_scroll_direction();
299 switch (direction) {
300 case Clutter.ScrollDirection.DOWN:
301 spaces.selectSequenceSpace(Meta.MotionDirection.DOWN);
302 Navigator.getNavigator().finish();
303 return Clutter.EVENT_STOP;
304 case Clutter.ScrollDirection.UP:
305 spaces.selectSequenceSpace(Meta.MotionDirection.UP);
306 Navigator.getNavigator().finish();
307 return Clutter.EVENT_STOP;
308 default:
309 return Clutter.EVENT_STOP;
310 }
311 });
312 this.workspaceIndicator = workspaceIndicator;

Callers

nothing calls this directly

Calls 14

hideMethod · 0.95
hideSelectionMethod · 0.95
setSettingsMethod · 0.95
showFocusModeIconMethod · 0.95
setMonitorMethod · 0.95
initMethod · 0.95
switchToNextFocusModeFunction · 0.85
setClickFunctionMethod · 0.80
connectMethod · 0.80
selectSequenceSpaceMethod · 0.80
getWorkspaceSettingsMethod · 0.80

Tested by

no test coverage detected