From 5f953510741e67cdd2553b9bf1696412745591d0 Mon Sep 17 00:00:00 2001 From: Cosimo Cecchi Date: Sat, 26 Jan 2013 03:41:46 -0500 Subject: [PATCH] tweener: follow org.gnome.desktop.interface enable-animations Disable the animations by making the animation time a very small value. https://bugzilla.gnome.org/show_bug.cgi?id=655746 --- js/ui/tweener.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/js/ui/tweener.js b/js/ui/tweener.js index ecfdb2008..65de2d897 100644 --- a/js/ui/tweener.js +++ b/js/ui/tweener.js @@ -1,6 +1,7 @@ // -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*- const Clutter = imports.gi.Clutter; +const Gio = imports.gi.Gio; const GLib = imports.gi.GLib; const Lang = imports.lang; const Mainloop = imports.mainloop; @@ -44,9 +45,12 @@ const Tweener = imports.tweener.tweener; // calls any of these is almost certainly wrong anyway, because they // affect the entire application.) +let animationSettings = null; + // Called from Main.start function init() { Tweener.setFrameTicker(new ClutterFrameTicker()); + animationSettings = new Gio.Settings({ schema: 'org.gnome.desktop.interface' }); } @@ -73,6 +77,9 @@ function _wrapTweening(target, tweeningParameters) { } } + if (!animationSettings.get_boolean('enable-animations')) + tweeningParameters['time'] = 0.000001; + _addHandler(target, tweeningParameters, 'onStart', _tweenStarted); _addHandler(target, tweeningParameters, 'onComplete', _tweenCompleted); }