[gnome-shell/wip/exalm/gestures: 11/11] tmp: Throttle SwipeTracker updates
- From: Alexander Mikhaylenko <alexm src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-shell/wip/exalm/gestures: 11/11] tmp: Throttle SwipeTracker updates
- Date: Mon, 5 Aug 2019 12:18:05 +0000 (UTC)
commit 72f56153caa9dd67a3676297c69bc5d59e07d4f6
Author: Alexander Mikhaylenko <exalm7659 gmail com>
Date: Mon Jul 8 14:31:07 2019 +0500
tmp: Throttle SwipeTracker updates
https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/605
js/ui/swipeTracker.js | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
---
diff --git a/js/ui/swipeTracker.js b/js/ui/swipeTracker.js
index 52f739f0e..a813f4a96 100644
--- a/js/ui/swipeTracker.js
+++ b/js/ui/swipeTracker.js
@@ -262,6 +262,8 @@ var SwipeTracker = class {
this._scrollGesture.connect('end', this._endGesture.bind(this));
} else
this._scrollGesture = null;
+
+ this._prevUpdate = 0;
}
get enabled() {
@@ -350,7 +352,12 @@ var SwipeTracker = class {
this._progress = clamp(this._progress, firstPoint, lastPoint);
this._progress = clamp(this._progress, this._initialProgress - 1, this._initialProgress + 1);
- this.emit('update', this._progress);
+ if (this._prevUpdate != 0)
+ Meta.later_remove(this._prevUpdate);
+ this._prevUpdate = Meta.later_add(Meta.LaterType.BEFORE_REDRAW, () => {
+ this.emit('update', this._progress);
+ this._prevUpdate = 0;
+ });
this._prevTime = time;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]