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

Method _pointerIsAtEdge

stackoverlay.js:241–263  ·  view source on GitHub ↗

* Returns true if pointer x position is at monitor edge. * @returns Boolean

()

Source from the content-addressed store, hash-verified

239 * @returns Boolean
240 */
241 _pointerIsAtEdge() {
242 const [x] = global.get_pointer();
243 switch (this._direction) {
244 case Meta.MotionDirection.LEFT:
245 if (
246 x >= this.monitor.x &&
247 x <= this.monitor.x + 2
248 ) {
249 return true;
250 }
251 break;
252 case Meta.MotionDirection.RIGHT:
253 if (
254 x <= this.monitor.x + this.monitor.width &&
255 x >= this.monitor.x + this.monitor.width - 2
256 ) {
257 return true;
258 }
259 break;
260 }
261
262 return false;
263 }
264
265 /**
266 * Triggers edge window preview.

Callers 2

_activateTargetMethod · 0.95
triggerPreviewMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected