~compiz-team/compiz-animation-plugin/oneiric

« back to all changes in this revision

Viewing changes to src/animation.cpp

  • Committer: Sam Spilsbury
  • Date: 2011-10-02 07:21:30 UTC
  • Revision ID: sam.spilsbury@canonical.com-20111002072130-zb1jqbevcrjcipp0
Cleanup animations in donePaint

Show diffs side-by-side

added added

removed removed

Lines of Context:
1343
1343
            }
1344
1344
        }
1345
1345
 
1346
 
        popLockedPaintList ();
1347
 
 
1348
 
        foreach (CompWindow *w, windowsFinishedAnimations)
1349
 
        {
1350
 
            AnimWindow *aw = AnimWindow::get (w);
1351
 
            aw->priv->notifyAnimation (false);
1352
 
            aw->priv->postAnimationCleanUp ();
1353
 
        }
1354
 
 
1355
 
        const CompWindowList &ppl = pushLockedPaintList ();
1356
 
 
1357
 
        foreach (CompWindow *w, ppl)
 
1346
        foreach (CompWindow *w, pl)
1358
1347
        {
1359
1348
            PrivateAnimWindow *aw = AnimWindow::get (w)->priv;
1360
1349
            if (aw->curAnimation ())
1361
1350
                aw->curAnimation ()->postPreparePaint ();
1362
1351
        }
1363
1352
 
1364
 
        if (!animStillInProgress)
1365
 
        {
1366
 
            activateEvent (false);
1367
 
            mLastRedrawTimeFresh = false;
1368
 
 
1369
 
            // Reset stacking related info after all animations are done.
1370
 
            ExtensionPluginAnimation *extPlugin =
1371
 
                static_cast<ExtensionPluginAnimation *> (mExtensionPlugins[0]);
1372
 
            extPlugin->resetStackingInfo ();
1373
 
        }
1374
 
 
1375
1353
        popLockedPaintList ();
1376
1354
    }
1377
1355
 
1396
1374
{
1397
1375
    assert (mAnimInProgress);
1398
1376
 
 
1377
    const CompWindowList &pl = pushLockedPaintList ();
 
1378
    CompWindowList       windowsFinishedAnimations;
 
1379
 
 
1380
    bool animStillInProgress = false;
 
1381
 
 
1382
    /* Paint list includes destroyed windows */
 
1383
    for (CompWindowList::const_reverse_iterator rit = pl.rbegin ();
 
1384
         rit != pl.rend (); rit++)
 
1385
    {
 
1386
        CompWindow *w = (*rit);
 
1387
        AnimWindow *animWin = AnimWindow::get (w);
 
1388
        PrivateAnimWindow *aw = animWin->priv;
 
1389
        Animation *curAnim = aw->curAnimation ();
 
1390
 
 
1391
        if (curAnim)
 
1392
        {
 
1393
            bool finished = (curAnim->remainingTime () <= 0);
 
1394
            if (finished) // Animation is done
 
1395
                windowsFinishedAnimations.push_back (w);
 
1396
            else
 
1397
                animStillInProgress = true;
 
1398
        }
 
1399
    }
 
1400
 
 
1401
    popLockedPaintList ();
 
1402
 
 
1403
    foreach (CompWindow *w, windowsFinishedAnimations)
 
1404
    {
 
1405
        AnimWindow *aw = AnimWindow::get (w);
 
1406
        aw->priv->notifyAnimation (false);
 
1407
        aw->priv->postAnimationCleanUp ();
 
1408
    }
 
1409
 
 
1410
    if (!animStillInProgress)
 
1411
    {
 
1412
        activateEvent (false);
 
1413
        mLastRedrawTimeFresh = false;
 
1414
 
 
1415
        // Reset stacking related info after all animations are done.
 
1416
        ExtensionPluginAnimation *extPlugin =
 
1417
                static_cast<ExtensionPluginAnimation *> (mExtensionPlugins[0]);
 
1418
        extPlugin->resetStackingInfo ();
 
1419
    }
 
1420
 
1399
1421
    cScreen->damagePending ();
1400
1422
 
1401
1423
    cScreen->donePaint ();