[gnome-shell/wip/fmuellner/ease-wm-animations: 1/5] environment: Support slow down factor when easing
- From: Florian Müllner <fmuellner src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-shell/wip/fmuellner/ease-wm-animations: 1/5] environment: Support slow down factor when easing
- Date: Wed, 15 May 2019 22:15:50 +0000 (UTC)
commit 94f12fa7646f99f122af9a21b46b81c22477af3e
Author: Florian Müllner <fmuellner gnome org>
Date: Thu Jun 5 00:13:14 2014 +0200
environment: Support slow down factor when easing
Being able to slow down animations is a helpful debugging tool; to not
lose it when starting to use Clutter's implicit animations, monkey-patch
the appropriate methods to support our global slow down factor.
https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/22
js/ui/environment.js | 13 +++++++++++++
1 file changed, 13 insertions(+)
---
diff --git a/js/ui/environment.js b/js/ui/environment.js
index f70394710..264c0dae2 100644
--- a/js/ui/environment.js
+++ b/js/ui/environment.js
@@ -57,6 +57,10 @@ function _patchLayoutClass(layoutClass, styleProps) {
};
}
+function _adjustEasingTime(msecs) {
+ return St.get_slow_down_factor() * msecs;
+}
+
function _loggingFunc() {
let fields = {'MESSAGE': [].join.call(arguments, ', ')};
let domain = "GNOME Shell";
@@ -93,6 +97,15 @@ function init() {
column_spacing: 'spacing-columns' });
_patchLayoutClass(Clutter.BoxLayout, { spacing: 'spacing' });
+ let origSetEasingDuration = Clutter.Actor.prototype.set_easing_duration;
+ Clutter.Actor.prototype.set_easing_duration = function(msecs) {
+ origSetEasingDuration.call(this, _adjustEasingTime(msecs));
+ };
+ let origSetEasingDelay = Clutter.Actor.prototype.set_easing_delay;
+ Clutter.Actor.prototype.set_easing_delay = function(msecs) {
+ origSetEasingDelay.call(this, _adjustEasingTime(msecs));
+ };
+
Clutter.Actor.prototype.toString = function() {
return St.describe_actor(this);
};
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]