<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -1046,9 +1046,10 @@ void TimeLine::setCurveShape(CurveShape curveShape)
 ***************************************************************/
 
 WindowMotionManager::WindowMotionManager( bool useGlobalAnimationModifier )
-    :   m_movingWindows( 0 )
+    :   m_useGlobalAnimationModifier( useGlobalAnimationModifier )
+    ,   m_movingWindows( 0 )
     { // TODO: Allow developer to modify motion attributes
-    } // TODO: useGlobalAnimationModifier
+    }
 
 WindowMotionManager::~WindowMotionManager()
     {
@@ -1056,11 +1057,21 @@ WindowMotionManager::~WindowMotionManager()
 
 void WindowMotionManager::manage( EffectWindow *w )
     {
-    // TODO: Apply global animation modifier
     if( m_managedWindows.contains( w ))
         return;
+
+    double strength = 7.5;
+    double decay = 0.5;
+    if( m_useGlobalAnimationModifier )
+        {
+        if( effects-&gt;animationTimeFactor() ) // If == 0 we just skip the calculation
+            strength = 7.5 * 1.0 / effects-&gt;animationTimeFactor();
+        decay = effects-&gt;animationTimeFactor() / ( effects-&gt;animationTimeFactor() + 1.0 );
+        }
+
     m_managedWindows[ w ] = WindowMotion();
-    m_managedWindows[ w ].scale.setDecay( 0.25 );
+    m_managedWindows[ w ].translation.setStrengthDecay( strength, decay );
+    m_managedWindows[ w ].scale.setStrengthDecay( strength, decay / 2.0 );
 
     m_managedWindows[ w ].translation.setValue( w-&gt;pos() );
     m_managedWindows[ w ].scale.setValue( QPointF( 1.0, 1.0 ));
@@ -1087,6 +1098,18 @@ void WindowMotionManager::unmanageAll()
 
 void WindowMotionManager::calculate( int time )
     {
+    if( !effects-&gt;animationTimeFactor() )
+        { // Just skip it completely if the user wants no animation
+        m_movingWindows = 0;
+        QHash&lt;EffectWindow*, WindowMotion&gt;::iterator it = m_managedWindows.begin();
+        for(; it != m_managedWindows.end(); it++ )
+            {
+            WindowMotion *motion = &amp;it.value();
+            motion-&gt;translation.finish();
+            motion-&gt;scale.finish();
+            }
+        }
+
     QHash&lt;EffectWindow*, WindowMotion&gt;::iterator it = m_managedWindows.begin();
     for(; it != m_managedWindows.end(); it++ )
         {
@@ -1094,6 +1117,7 @@ void WindowMotionManager::calculate( int time )
         bool stopped = false;
 
         // TODO: What happens when distance() == 0 but we are still moving fast?
+        // TODO: Motion needs to be calculated from the window's center
 
         QPointF diffT = motion-&gt;translation.distance();
         if( diffT != QPoint( 0.0, 0.0 ))</diff>
      <filename>lib/kwineffects.cpp</filename>
    </modified>
    <modified>
      <diff>@@ -1261,6 +1261,7 @@ class KWIN_EXPORT WindowMotionManager
         inline bool areWindowsMoving() { return m_movingWindows &gt; 0; }
 
     private:
+        bool m_useGlobalAnimationModifier;
         struct WindowMotion
             { // TODO: Rotation, etc?
             Motion&lt;QPointF&gt; translation; // Absolute position</diff>
      <filename>lib/kwineffects.h</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>6cb77a6de5e0e7f45781ee91bee7345b28426e67</id>
    </parent>
  </parents>
  <author>
    <name>Lucas Murray</name>
    <email>lmurray@undefinedfire.com</email>
  </author>
  <url>http://github.com/Zarin/kwin/commit/5ece56d33280575edbf77cec41cfa34c72e15a85</url>
  <id>5ece56d33280575edbf77cec41cfa34c72e15a85</id>
  <committed-date>2008-09-22T04:45:12-07:00</committed-date>
  <authored-date>2008-09-22T04:45:12-07:00</authored-date>
  <message>Use the global animation modifier.</message>
  <tree>9cc291fd6d58f0e2ffe10974957d456afe6c9d89</tree>
  <committer>
    <name>Lucas Murray</name>
    <email>lmurray@undefinedfire.com</email>
  </committer>
</commit>
