[gnome-shell/wip/exalm/gestures: 23/23] tmp: Throttle SwipeTracker updates
- From: Alexander Mikhaylenko <alexm src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-shell/wip/exalm/gestures: 23/23] tmp: Throttle SwipeTracker updates
- Date: Thu, 25 Jul 2019 11:19:08 +0000 (UTC)
commit 3e667f4ca7cf730f60ca09d2d77631005697ede7
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 | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)
---
diff --git a/js/ui/swipeTracker.js b/js/ui/swipeTracker.js
index 1cbd99331..ed7ffc28c 100644
--- a/js/ui/swipeTracker.js
+++ b/js/ui/swipeTracker.js
@@ -287,6 +287,8 @@ var SwipeTracker = class {
this._scrollGesture.connect('end', this._endGesture.bind(this));
} else
this._scrollGesture = null;
+
+ this._prevUpdate = 0;
}
get enabled() {
@@ -377,7 +379,13 @@ var SwipeTracker = class {
// Clamp progress to [0,1]
let progress = this._progress / (1 + (this._progress > 0 ? this._backExtent : this._forwardExtent) /
this._distance);
- this.emit('update', progress);
+
+ if (this._prevUpdate != 0)
+ Meta.later_remove(this._prevUpdate);
+ this._prevUpdate = Meta.later_add(Meta.LaterType.BEFORE_REDRAW, () => {
+ this.emit('update', progress);
+ this._prevUpdate = 0;
+ });
this._prevTime = time;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]