From eec4b6d59d5964cc2d9433800724d6a6bdc64699 Mon Sep 17 00:00:00 2001 From: TheSola10 Date: Sun, 10 Dec 2023 23:20:35 +0100 Subject: [PATCH] Fixed coordinate retrieval in update function --- grab.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/grab.js b/grab.js index af2fc9b5..2568684b 100644 --- a/grab.js +++ b/grab.js @@ -85,11 +85,11 @@ export class MoveGrab { center && clone.set_pivot_point(0, 0); this.signals.connect(this.actor, "button-release-event", this.end.bind(this)); - this.signals.connect(this.actor, "touch-event", (evt) => { + this.signals.connect(this.actor, "touch-event", (act, evt) => { if (evt.type() == Clutter.EventType.TOUCH_END) this.end(); - else if (evt.type() == Clutter.EventType.TOUCH_UPDATE) - this.motion(this.actor, evt); + else + this.motion(act, evt); }); this.signals.connect(this.actor, "motion-event", this.motion.bind(this)); this.signals.connect(global.display, "window-entered-monitor", @@ -307,6 +307,8 @@ export class MoveGrab { let metaWindow = this.window; // let [gx, gy] = event.get_coords(); let [gx, gy, $] = global.get_pointer(); + if (event.type() == Clutter.EventType.TOUCH_UPDATE) + [gx, gy] = event.get_coords(); let [dx, dy] = this.pointerOffset; let clone = metaWindow.clone;