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

Function enableMultimonitorSupport

stackoverlay.js:71–107  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

69}
70
71export function enableMultimonitorSupport() {
72 pointerWatch = PointerWatcher.getPointerWatcher().addWatch(100,
73 () => {
74 // if overview return
75 if (Main.overview.visible) {
76 return;
77 }
78
79 const monitor = Utils.monitorAtCurrentPoint();
80 const space = Tiling.spaces.monitors.get(monitor);
81
82 // same space
83 if (space === Tiling.spaces.activeSpace) {
84 return;
85 }
86
87 // check if in the midst of a window resize action
88 if (Tiling.inGrab &&
89 Tiling.inGrab instanceof Grab.ResizeGrab) {
90 const window = global.display?.focus_window;
91 if (window) {
92 Scratch.makeScratch(window);
93 }
94 return;
95 }
96
97 // if drag/grabbing window, do simple activate
98 if (Tiling.inGrab) {
99 space?.activate(false, false);
100 return;
101 }
102
103 const selected = space?.selectedWindow;
104 space?.activateWithFocus(selected, false, false);
105 });
106 console.debug('paperwm multimonitor support is ENABLED');
107}
108
109export function disableMultimonitorSupport() {
110 pointerWatch?.remove();

Callers 1

multimonitorSupportFunction · 0.85

Calls 2

activateWithFocusMethod · 0.80
activateMethod · 0.45

Tested by

no test coverage detected