Skip to content

Commit d26822b

Browse files
committed
Sync SwipeTracker to GNOME 50
Includes part of [gnome-shell!3931][1], which should still be safe for `swipeTracker.js` in GNOME 49. [1]: https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3931 "Use const declarations where possible"
1 parent d44b7ef commit d26822b

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

src/swipeTracker.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ const TouchpadSwipeGesture = GObject.registerClass({
137137
if (this._state === TouchpadState.IGNORED)
138138
return Clutter.EVENT_PROPAGATE;
139139

140-
let time = event.get_time();
140+
const time = event.get_time();
141141

142142
const [x, y] = event.get_coords();
143143
const [dx, dy] = event.get_gesture_motion_delta_unaccelerated();
@@ -284,16 +284,16 @@ const ScrollGesture = GObject.registerClass({
284284
const vertical = this.orientation === Clutter.Orientation.VERTICAL;
285285
const distance = vertical ? TOUCHPAD_BASE_HEIGHT : TOUCHPAD_BASE_WIDTH;
286286

287-
let time = event.get_time();
288-
let [dx, dy] = event.get_scroll_delta();
287+
const time = event.get_time();
288+
const [dx, dy] = event.get_scroll_delta();
289289
if (dx === 0 && dy === 0) {
290290
this.emit('end', time, distance);
291291
this._began = false;
292292
return Clutter.EVENT_STOP;
293293
}
294294

295295
if (!this._began) {
296-
let [x, y] = event.get_coords();
296+
const [x, y] = event.get_coords();
297297
this.emit('begin', time, x, y);
298298
this._began = true;
299299
}
@@ -611,7 +611,7 @@ export const SwipeTracker = GObject.registerClass({
611611
return;
612612

613613
const rect = new Mtk.Rectangle({x, y, width: 1, height: 1});
614-
let monitor = global.display.get_monitor_index_for_rect(rect);
614+
const monitor = global.display.get_monitor_index_for_rect(rect);
615615

616616
this.emit('begin', monitor);
617617
}

0 commit comments

Comments
 (0)