From 5fb267ccac322db05d23e7fd055b3a07a642823b Mon Sep 17 00:00:00 2001 From: bill-auger Date: Thu, 27 Jun 2019 08:52:06 -0400 Subject: [wbar]: bugfix (issue #2342) --- pcr-testing/wbar/remove_static_iterator.patch | 65 +++++++++++++++++++++++++++ 1 file changed, 65 insertions(+) create mode 100644 pcr-testing/wbar/remove_static_iterator.patch (limited to 'pcr-testing/wbar/remove_static_iterator.patch') 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 list; +-static std::list::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::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; + } + -- cgit v1.2.3