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

Method constructor

stackoverlay.js:169–216  ·  view source on GitHub ↗
(direction, monitor)

Source from the content-addressed store, hash-verified

167
168export class StackOverlay {
169 constructor(direction, monitor) {
170 this.SHOW_DELAY = 100;
171
172 this._direction = direction;
173
174 const overlay = new Clutter.Actor({
175 reactive: true,
176 name: "stack-overlay",
177 });
178
179 // Uncomment to debug the overlays
180 // overlay.background_color = Utils.color_from_string('green')[1];
181 // overlay.opacity = 100;
182
183 this.monitor = monitor;
184 const panelBox = Main.layoutManager.panelBox;
185 overlay.y = monitor.y + panelBox.height + Settings.prefs.vertical_margin;
186 overlay.height = this.monitor.height - panelBox.height - Settings.prefs.vertical_margin;
187 overlay.width = Tiling.stack_margin;
188
189 this.signals = new Utils.Signals();
190
191 // preview timeouts
192 this.triggerPreviewTimeout = null;
193 this.showPreviewTimeout = null;
194 this.activatePreviewTimeout = null;
195
196 this.signals.connect(overlay, 'button-press-event', () => {
197 if (!Settings.prefs.edge_preview_enable) {
198 return;
199 }
200
201 if (!Settings.prefs.edge_preview_click_enable) {
202 return;
203 }
204
205 this._activateTarget();
206 });
207
208 this.signals.connect(overlay, 'enter-event', () => this.triggerPreview());
209 this.signals.connect(overlay, 'leave-event', () => this.removePreview());
210
211 global.window_group.add_child(overlay);
212 Main.layoutManager.trackChrome(overlay);
213
214 this.overlay = overlay;
215 this.setTarget(null);
216 }
217
218 _activateTarget() {
219 Main.activateWindow(this.target);

Callers

nothing calls this directly

Calls 5

_activateTargetMethod · 0.95
triggerPreviewMethod · 0.95
removePreviewMethod · 0.95
setTargetMethod · 0.95
connectMethod · 0.80

Tested by

no test coverage detected