Skip to content

Commit

Permalink
Fixed coordinate retrieval in update function
Browse files Browse the repository at this point in the history
  • Loading branch information
Thesola10 committed Jan 28, 2024
1 parent b732874 commit eec4b6d
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions grab.js
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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;

Expand Down

0 comments on commit eec4b6d

Please sign in to comment.