From 9e230d4df798a6a4fdbd99fe49ef597f02f6e665 Mon Sep 17 00:00:00 2001 From: Simon Schneegans Date: Sun, 9 Jan 2022 13:19:49 +0100 Subject: [PATCH] :wrench: Change animation duration directly --- extension.js | 23 +---------------------- 1 file changed, 1 insertion(+), 22 deletions(-) diff --git a/extension.js b/extension.js index 689e926..8138194 100644 --- a/extension.js +++ b/extension.js @@ -58,25 +58,6 @@ class Extension { this._origAddWindowClone = Workspace.prototype._addWindowClone; this._origShouldAnimateActor = WindowManager.prototype._shouldAnimateActor; - // We may also override these animation times. - this._origWindowTime = imports.ui.windowManager.DESTROY_WINDOW_ANIMATION_TIME; - this._origDialogTime = imports.ui.windowManager.DIALOG_DESTROY_WINDOW_ANIMATION_TIME; - - // Update animation times if the respective settings are changed. - const loadAnimationTimes = () => { - imports.ui.windowManager.DESTROY_WINDOW_ANIMATION_TIME = - this._settings.get_int('destroy-animation-time'); - - imports.ui.windowManager.DIALOG_DESTROY_WINDOW_ANIMATION_TIME = - this._settings.get_boolean('destroy-dialogs') ? - this._settings.get_int('destroy-animation-time') : - this._origDialogTime; - }; - - this._settings.connect('changed::destroy-animation-time', loadAnimationTimes); - this._settings.connect('changed::destroy-dialogs', loadAnimationTimes); - loadAnimationTimes(); - // We will use extensionThis to refer to the extension inside the patched methods of // the WorkspacesView. const extensionThis = this; @@ -158,6 +139,7 @@ class Extension { if (transition) { transition.set_to(value); transition.set_progress_mode(Clutter.AnimationMode.EASE_OUT_QUAD); + transition.set_duration(1500); } }; @@ -213,9 +195,6 @@ class Extension { Workspace.prototype._addWindowClone = this._origAddWindowClone; WindowManager.prototype._shouldAnimateActor = this._origShouldAnimateActor; - imports.ui.windowManager.DESTROY_WINDOW_ANIMATION_TIME = this._origWindowTime; - imports.ui.windowManager.DIALOG_DESTROY_WINDOW_ANIMATION_TIME = this._origDialogTime; - this._settings = null; }