summaryrefslogtreecommitdiff
path: root/pcr-testing/wbar/remove_static_iterator.patch
diff options
context:
space:
mode:
Diffstat (limited to 'pcr-testing/wbar/remove_static_iterator.patch')
-rw-r--r--pcr-testing/wbar/remove_static_iterator.patch65
1 files changed, 65 insertions, 0 deletions
diff --git a/pcr-testing/wbar/remove_static_iterator.patch b/pcr-testing/wbar/remove_static_iterator.patch
new file mode 100644
index 000000000..574c6775b
--- /dev/null
+++ b/pcr-testing/wbar/remove_static_iterator.patch
@@ -0,0 +1,65 @@
+diff --git a/src/core/Main.cc b/src/core/Main.cc
+index c170e63..b6fa5f1 100644
+--- a/src/core/Main.cc
++++ b/src/core/Main.cc
+@@ -18,7 +18,6 @@
+ static size_t configitems;
+ static unsigned int taskbar;
+ static std::list<App *> list;
+-static std::list<App *>::iterator it;
+ static App *p;
+
+ static Bar *barra;
+@@ -69,8 +68,7 @@ int main(int argc, char **argv)
+
+ if (list.size() != 0)
+ {
+- it = list.begin();
+- p = (*it);
++ p = *list.begin();
+ }
+ else
+ {
+@@ -440,7 +438,6 @@ int mapIcons()
+ {
+ list.pop_back();
+ ((SuperBar *)barra)->removeIcon();
+- it--;
+ }
+ // add currently running tasks to the list
+ if ( (taskbar) &&
+@@ -481,15 +478,17 @@ int mapIcons()
+ }
+ }
+ }
+- //if this is not an initial run
+- if (!firstrun)
+- // and we added no windows
+- if ((size_t)list.size() == configitems)
+- //then there is no need to add icons
++
++ // if this is not an initial run and we added no windows
++ // then there is no need to add icons
++ if (!firstrun && (size_t)list.size() == configitems)
+ return 0;
+- for (it++; it != list.end(); it++)
++
++ std::list<App *>::iterator appsIt = list.begin();
++ while ((size_t)std::distance(list.begin(), ++appsIt) < configitems);
++ while (++appsIt != list.end())
+ {
+- p = (*it);
++ p = *appsIt;
+ try
+ {
+ if (p->getIconName() != "")
+@@ -518,8 +517,7 @@ int mapIcons()
+ }
+ (void) XSetErrorHandler(oldXHandler);
+ barra->scale();
+- if (firstrun)
+- it--;
++
+ return 0;
+ }
+