Merge lp:~compiz-team/compiz-animation-plugin/compiz-animation-plugin.fix_crash into lp:compiz-animation-plugin

Proposed by Sam Spilsbury
Status: Merged
Approved by: Neil J. Patel
Approved revision: 384
Merged at revision: 383
Proposed branch: lp:~compiz-team/compiz-animation-plugin/compiz-animation-plugin.fix_crash
Merge into: lp:compiz-animation-plugin
Diff against target: 136 lines (+17/-13)
2 files modified
src/animation.cpp (+10/-6)
src/extensionplugin.cpp (+7/-7)
To merge this branch: bzr merge lp:~compiz-team/compiz-animation-plugin/compiz-animation-plugin.fix_crash
Reviewer Review Type Date Requested Status
Neil J. Patel (community) Approve
Review via email: mp+75499@code.launchpad.net

Description of the change

Fixes a crash when using boost foreach

To post a comment you must log in.
Revision history for this message
Neil J. Patel (njpatel) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'src/animation.cpp'
--- src/animation.cpp 2011-08-23 10:33:25 +0000
+++ src/animation.cpp 2011-09-15 08:50:41 +0000
@@ -318,7 +318,7 @@
318 if (shouldInitPersistentData)318 if (shouldInitPersistentData)
319 {319 {
320 // Initialize persistent window data for the extension plugin320 // Initialize persistent window data for the extension plugin
321 foreach (CompWindow *w, ::screen->windows ())321 foreach (CompWindow *w, cScreen->getWindowPaintList ())
322 {322 {
323 AnimWindow *aw = AnimWindow::get (w);323 AnimWindow *aw = AnimWindow::get (w);
324 extensionPluginInfo->initPersistentData (aw);324 extensionPluginInfo->initPersistentData (aw);
@@ -336,7 +336,7 @@
336PrivateAnimScreen::removeExtension (ExtensionPluginInfo *extensionPluginInfo)336PrivateAnimScreen::removeExtension (ExtensionPluginInfo *extensionPluginInfo)
337{337{
338 // Stop all ongoing animations338 // Stop all ongoing animations
339 foreach (CompWindow *w, ::screen->windows ())339 foreach (CompWindow *w, cScreen->getWindowPaintList ())
340 {340 {
341 PrivateAnimWindow *aw = AnimWindow::get (w)->priv;341 PrivateAnimWindow *aw = AnimWindow::get (w)->priv;
342 if (aw->curAnimation ())342 if (aw->curAnimation ())
@@ -391,7 +391,7 @@
391 }391 }
392392
393 // Destroy persistent window data for the extension plugin393 // Destroy persistent window data for the extension plugin
394 foreach (CompWindow *w, ::screen->windows ())394 foreach (CompWindow *w, cScreen->getWindowPaintList ())
395 {395 {
396 AnimWindow *aw = AnimWindow::get (w);396 AnimWindow *aw = AnimWindow::get (w);
397 extensionPluginInfo->destroyPersistentData (aw);397 extensionPluginInfo->destroyPersistentData (aw);
@@ -1229,6 +1229,7 @@
1229 if (mAnimInProgress)1229 if (mAnimInProgress)
1230 { 1230 {
1231 int msSinceLastPaintActual;1231 int msSinceLastPaintActual;
1232 const CompWindowList &pl = cScreen->getWindowPaintList ();
12321233
1233 struct timeval curTime;1234 struct timeval curTime;
1234 gettimeofday (&curTime, 0);1235 gettimeofday (&curTime, 0);
@@ -1248,8 +1249,11 @@
12481249
1249 bool animStillInProgress = false;1250 bool animStillInProgress = false;
12501251
1251 foreach (CompWindow *w, ::screen->windows ())1252 /* Paint list includes destroyed windows */
1253 for (CompWindowList::const_reverse_iterator rit = pl.rbegin ();
1254 rit != pl.rend (); rit++)
1252 {1255 {
1256 CompWindow *w = (*rit);
1253 AnimWindow *animWin = AnimWindow::get (w);1257 AnimWindow *animWin = AnimWindow::get (w);
1254 PrivateAnimWindow *aw = animWin->priv;1258 PrivateAnimWindow *aw = animWin->priv;
1255 Animation *curAnim = aw->curAnimation ();1259 Animation *curAnim = aw->curAnimation ();
@@ -1331,7 +1335,7 @@
1331 }1335 }
1332 }1336 }
13331337
1334 foreach (CompWindow *w, ::screen->windows ())1338 foreach (CompWindow *w, cScreen->getWindowPaintList ())
1335 {1339 {
1336 PrivateAnimWindow *aw = AnimWindow::get (w)->priv;1340 PrivateAnimWindow *aw = AnimWindow::get (w)->priv;
1337 if (aw->curAnimation ())1341 if (aw->curAnimation ())
@@ -2258,7 +2262,7 @@
2258PrivateAnimScreen::updateAnimStillInProgress ()2262PrivateAnimScreen::updateAnimStillInProgress ()
2259{2263{
2260 bool animStillInProgress = false;2264 bool animStillInProgress = false;
2261 foreach (CompWindow *w, ::screen->windows ())2265 foreach (CompWindow *w, cScreen->getWindowPaintList ())
2262 {2266 {
2263 PrivateAnimWindow *aw = AnimWindow::get (w)->priv;2267 PrivateAnimWindow *aw = AnimWindow::get (w)->priv;
2264 if (aw->curAnimation () &&2268 if (aw->curAnimation () &&
22652269
=== modified file 'src/extensionplugin.cpp'
--- src/extensionplugin.cpp 2010-08-11 23:53:47 +0000
+++ src/extensionplugin.cpp 2011-09-15 08:50:41 +0000
@@ -412,7 +412,7 @@
412 onlyTwo = true;412 onlyTwo = true;
413 }413 }
414 // Clear all mConfigureNotified's414 // Clear all mConfigureNotified's
415 foreach (CompWindow *w2, ::screen->windows ())415 foreach (CompWindow *w2, CompositeScreen::get (::screen)->getWindowPaintList ())
416 {416 {
417 RestackPersistentData *data =417 RestackPersistentData *data =
418 static_cast<RestackPersistentData *>418 static_cast<RestackPersistentData *>
@@ -514,7 +514,7 @@
514 // was not possible.514 // was not possible.
515 updateLastClientList ();515 updateLastClientList ();
516516
517 foreach (CompWindow *w, ::screen->windows ())517 foreach (CompWindow *w, CompositeScreen::get (::screen)->getWindowPaintList ())
518 {518 {
519 AnimWindow *aw = AnimWindow::get (w);519 AnimWindow *aw = AnimWindow::get (w);
520 // Allocate persistent restack data if it doesn't already exist520 // Allocate persistent restack data if it doesn't already exist
@@ -526,7 +526,7 @@
526 }526 }
527 if (as->isAnimEffectPossible (AnimEffectDodge))527 if (as->isAnimEffectPossible (AnimEffectDodge))
528 {528 {
529 foreach (CompWindow *w, ::screen->windows ())529 foreach (CompWindow *w, CompositeScreen::get (::screen)->getWindowPaintList ())
530 {530 {
531 AnimWindow *aw = AnimWindow::get (w);531 AnimWindow *aw = AnimWindow::get (w);
532 // Allocate persistent dodge data if it doesn't already exist532 // Allocate persistent dodge data if it doesn't already exist
@@ -600,7 +600,7 @@
600 bool wOldAboveGood = false;600 bool wOldAboveGood = false;
601 bool wRestackedGood = false;601 bool wRestackedGood = false;
602602
603 foreach (CompWindow *w, ::screen->windows ())603 foreach (CompWindow *w, CompositeScreen::get (::screen)->getWindowPaintList ())
604 {604 {
605 AnimWindow *aw = AnimWindow::get (w);605 AnimWindow *aw = AnimWindow::get (w);
606606
@@ -623,7 +623,7 @@
623void623void
624ExtensionPluginAnimation::resetStackingInfo ()624ExtensionPluginAnimation::resetStackingInfo ()
625{625{
626 foreach (CompWindow *w, ::screen->windows ())626 foreach (CompWindow *w, CompositeScreen::get (::screen)->getWindowPaintList ())
627 {627 {
628 AnimWindow *aw = AnimWindow::get (w);628 AnimWindow *aw = AnimWindow::get (w);
629 PersistentDataMap::iterator itData =629 PersistentDataMap::iterator itData =
@@ -737,7 +737,7 @@
737void737void
738ExtensionPluginAnimation::resetMarks ()738ExtensionPluginAnimation::resetMarks ()
739{739{
740 foreach (CompWindow *w, ::screen->windows ())740 foreach (CompWindow *w, CompositeScreen::get (::screen)->getWindowPaintList ())
741 {741 {
742 RestackPersistentData *data = static_cast<RestackPersistentData *>742 RestackPersistentData *data = static_cast<RestackPersistentData *>
743 (AnimWindow::get (w)->persistentData["restack"]);743 (AnimWindow::get (w)->persistentData["restack"]);
@@ -758,7 +758,7 @@
758 resetMarks ();758 resetMarks ();
759759
760 CompWindow *w =760 CompWindow *w =
761 getBottommostInExtendedFocusChain (*::screen->windows ().begin ());761 getBottommostInExtendedFocusChain (*CompositeScreen::get (::screen)->getWindowPaintList ().begin ());
762 if (w)762 if (w)
763 {763 {
764 RestackPersistentData *data = static_cast<RestackPersistentData *>764 RestackPersistentData *data = static_cast<RestackPersistentData *>

Subscribers

People subscribed via source and target branches

to all changes: