From 32faeb3f7cf2d6d4712d35243b26a878a41e45b4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ole=20J=C3=B8rgen=20Br=C3=B8nner?= Date: Sun, 15 Mar 2020 12:20:59 +0100 Subject: [PATCH] Proof-of-concept: when pressure-barrier is on the monitor is "jailed" when super is not held down. --- stackoverlay.js | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/stackoverlay.js b/stackoverlay.js index 05ccd0d..9306453 100644 --- a/stackoverlay.js +++ b/stackoverlay.js @@ -346,7 +346,22 @@ var StackOverlay = class StackOverlay { y2: workArea.y + workArea.height - 1, directions }); - this.pressureBarrier.addBarrier(this.barrier); + + this.barrier.connect('hit', (_, event) => { + let [x, y, mod] = global.get_pointer(); + for (let [k, v] of Object.entries(Clutter.ModifierType)) { + if (Clutter.ModifierType[k] & mod) { + // print(k); + } + } + + if (mod & Clutter.ModifierType.MOD4_MASK) { + this.barrier.release(event); + // this.pressureBarrier.removeBarrier(this.barrier); + } + }); + + // this.pressureBarrier.addBarrier(this.barrier); } setTarget(space, index) {