adapt to Clutter API changes

device.get_coords() has been removed and seat.query_state() is unusable with null sequences.
This commit is contained in:
abakkk 2021-02-19 22:44:10 +01:00
parent d125d77d01
commit 137742d471
1 changed files with 11 additions and 3 deletions

14
area.js
View File

@ -735,9 +735,17 @@ var DrawingArea = new Lang.Class({
// Minimum time between two motion events is about 33 ms. // Minimum time between two motion events is about 33 ms.
// Add intermediate points to make quick free drawings smoother. // Add intermediate points to make quick free drawings smoother.
this.motionTimeout = GLib.timeout_add(GLib.PRIORITY_DEFAULT, MOTION_TIME, () => { this.motionTimeout = GLib.timeout_add(GLib.PRIORITY_DEFAULT, MOTION_TIME, () => {
let [success, coords] = device.get_coords(sequence); let success, coords;
if (!success) if (device.get_coords) {
return GLib.SOURCE_CONTINUE; [success, coords] = device.get_coords(sequence);
if (!success)
return GLib.SOURCE_CONTINUE;
} else {
// GS 40+, device.get_coords() has been removed
// and seat.query_state() is unusable with null sequences.
let pointer = global.get_pointer();
coords = { x: pointer[0], y: pointer[1] };
}
let [s, x, y] = this._transformStagePoint(coords.x, coords.y); let [s, x, y] = this._transformStagePoint(coords.x, coords.y);
if (!s) if (!s)