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
1=== modified file 'src/animation.cpp'
2--- src/animation.cpp 2011-08-23 10:33:25 +0000
3+++ src/animation.cpp 2011-09-15 08:50:41 +0000
4@@ -318,7 +318,7 @@
5 if (shouldInitPersistentData)
6 {
7 // Initialize persistent window data for the extension plugin
8- foreach (CompWindow *w, ::screen->windows ())
9+ foreach (CompWindow *w, cScreen->getWindowPaintList ())
10 {
11 AnimWindow *aw = AnimWindow::get (w);
12 extensionPluginInfo->initPersistentData (aw);
13@@ -336,7 +336,7 @@
14 PrivateAnimScreen::removeExtension (ExtensionPluginInfo *extensionPluginInfo)
15 {
16 // Stop all ongoing animations
17- foreach (CompWindow *w, ::screen->windows ())
18+ foreach (CompWindow *w, cScreen->getWindowPaintList ())
19 {
20 PrivateAnimWindow *aw = AnimWindow::get (w)->priv;
21 if (aw->curAnimation ())
22@@ -391,7 +391,7 @@
23 }
24
25 // Destroy persistent window data for the extension plugin
26- foreach (CompWindow *w, ::screen->windows ())
27+ foreach (CompWindow *w, cScreen->getWindowPaintList ())
28 {
29 AnimWindow *aw = AnimWindow::get (w);
30 extensionPluginInfo->destroyPersistentData (aw);
31@@ -1229,6 +1229,7 @@
32 if (mAnimInProgress)
33 {
34 int msSinceLastPaintActual;
35+ const CompWindowList &pl = cScreen->getWindowPaintList ();
36
37 struct timeval curTime;
38 gettimeofday (&curTime, 0);
39@@ -1248,8 +1249,11 @@
40
41 bool animStillInProgress = false;
42
43- foreach (CompWindow *w, ::screen->windows ())
44+ /* Paint list includes destroyed windows */
45+ for (CompWindowList::const_reverse_iterator rit = pl.rbegin ();
46+ rit != pl.rend (); rit++)
47 {
48+ CompWindow *w = (*rit);
49 AnimWindow *animWin = AnimWindow::get (w);
50 PrivateAnimWindow *aw = animWin->priv;
51 Animation *curAnim = aw->curAnimation ();
52@@ -1331,7 +1335,7 @@
53 }
54 }
55
56- foreach (CompWindow *w, ::screen->windows ())
57+ foreach (CompWindow *w, cScreen->getWindowPaintList ())
58 {
59 PrivateAnimWindow *aw = AnimWindow::get (w)->priv;
60 if (aw->curAnimation ())
61@@ -2258,7 +2262,7 @@
62 PrivateAnimScreen::updateAnimStillInProgress ()
63 {
64 bool animStillInProgress = false;
65- foreach (CompWindow *w, ::screen->windows ())
66+ foreach (CompWindow *w, cScreen->getWindowPaintList ())
67 {
68 PrivateAnimWindow *aw = AnimWindow::get (w)->priv;
69 if (aw->curAnimation () &&
70
71=== modified file 'src/extensionplugin.cpp'
72--- src/extensionplugin.cpp 2010-08-11 23:53:47 +0000
73+++ src/extensionplugin.cpp 2011-09-15 08:50:41 +0000
74@@ -412,7 +412,7 @@
75 onlyTwo = true;
76 }
77 // Clear all mConfigureNotified's
78- foreach (CompWindow *w2, ::screen->windows ())
79+ foreach (CompWindow *w2, CompositeScreen::get (::screen)->getWindowPaintList ())
80 {
81 RestackPersistentData *data =
82 static_cast<RestackPersistentData *>
83@@ -514,7 +514,7 @@
84 // was not possible.
85 updateLastClientList ();
86
87- foreach (CompWindow *w, ::screen->windows ())
88+ foreach (CompWindow *w, CompositeScreen::get (::screen)->getWindowPaintList ())
89 {
90 AnimWindow *aw = AnimWindow::get (w);
91 // Allocate persistent restack data if it doesn't already exist
92@@ -526,7 +526,7 @@
93 }
94 if (as->isAnimEffectPossible (AnimEffectDodge))
95 {
96- foreach (CompWindow *w, ::screen->windows ())
97+ foreach (CompWindow *w, CompositeScreen::get (::screen)->getWindowPaintList ())
98 {
99 AnimWindow *aw = AnimWindow::get (w);
100 // Allocate persistent dodge data if it doesn't already exist
101@@ -600,7 +600,7 @@
102 bool wOldAboveGood = false;
103 bool wRestackedGood = false;
104
105- foreach (CompWindow *w, ::screen->windows ())
106+ foreach (CompWindow *w, CompositeScreen::get (::screen)->getWindowPaintList ())
107 {
108 AnimWindow *aw = AnimWindow::get (w);
109
110@@ -623,7 +623,7 @@
111 void
112 ExtensionPluginAnimation::resetStackingInfo ()
113 {
114- foreach (CompWindow *w, ::screen->windows ())
115+ foreach (CompWindow *w, CompositeScreen::get (::screen)->getWindowPaintList ())
116 {
117 AnimWindow *aw = AnimWindow::get (w);
118 PersistentDataMap::iterator itData =
119@@ -737,7 +737,7 @@
120 void
121 ExtensionPluginAnimation::resetMarks ()
122 {
123- foreach (CompWindow *w, ::screen->windows ())
124+ foreach (CompWindow *w, CompositeScreen::get (::screen)->getWindowPaintList ())
125 {
126 RestackPersistentData *data = static_cast<RestackPersistentData *>
127 (AnimWindow::get (w)->persistentData["restack"]);
128@@ -758,7 +758,7 @@
129 resetMarks ();
130
131 CompWindow *w =
132- getBottommostInExtendedFocusChain (*::screen->windows ().begin ());
133+ getBottommostInExtendedFocusChain (*CompositeScreen::get (::screen)->getWindowPaintList ().begin ());
134 if (w)
135 {
136 RestackPersistentData *data = static_cast<RestackPersistentData *>

Subscribers

People subscribed via source and target branches

to all changes: