[gnome-shell/gnome-3-28] magnifier.js: Fix zoom juddering
- From: Marco Trevisan <marcotrevi src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-shell/gnome-3-28] magnifier.js: Fix zoom juddering
- Date: Thu, 7 Jun 2018 08:43:08 +0000 (UTC)
commit 9f76b6e4a2d3cffad7a52933a61d8ecb0d38e844
Author: Daniel van Vugt <daniel van vugt canonical com>
Date: Thu May 10 18:13:49 2018 +0800
magnifier.js: Fix zoom juddering
Make Zoom respond to the mouse silky-smoothly.
It was previously hard-coded to: 1000/50 = 20 FPS.
https://bugzilla.gnome.org/show_bug.cgi?id=682013
https://launchpad.net/bugs/1691675
(cherry picked from commit 94101e8bb88e86e8ae9f07ae4e0e4fc568441a2d)
js/ui/magnifier.js | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
---
diff --git a/js/ui/magnifier.js b/js/ui/magnifier.js
index b752b127a..3103630ca 100644
--- a/js/ui/magnifier.js
+++ b/js/ui/magnifier.js
@@ -19,7 +19,6 @@ const MagnifierDBus = imports.ui.magnifierDBus;
const Params = imports.misc.params;
const PointerWatcher = imports.ui.pointerWatcher;
-var MOUSE_POLL_FREQUENCY = 50;
var CROSSHAIRS_CLIP_SIZE = [100, 100];
var NO_CHANGE = 0.0;
@@ -152,8 +151,10 @@ var Magnifier = new Lang.Class({
* Turn on mouse tracking, if not already doing so.
*/
startTrackingMouse() {
- if (!this._pointerWatch)
- this._pointerWatch = PointerWatcher.getPointerWatcher().addWatch(MOUSE_POLL_FREQUENCY,
this.scrollToMousePos.bind(this));
+ if (!this._pointerWatch) {
+ let interval = 1000 / Clutter.get_default_frame_rate();
+ this._pointerWatch = PointerWatcher.getPointerWatcher().addWatch(interval,
this.scrollToMousePos.bind(this));
+ }
},
/**
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]