From 5a030d5ec1750f34d1e798bf347ebf719d24a106 Mon Sep 17 00:00:00 2001 From: Dana Jansens Date: Sun, 8 Dec 2002 04:57:08 +0000 Subject: [PATCH] fix bug with infinate loop when cycling backwards on an empty workspace --- util/epist/screen.cc | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/util/epist/screen.cc b/util/epist/screen.cc index ca029652..63b9578d 100644 --- a/util/epist/screen.cc +++ b/util/epist/screen.cc @@ -589,7 +589,6 @@ void screen::execCommand(const string &cmd) const { } } - void screen::cycleWindow(unsigned int state, const bool forward, const int increment, const bool allscreens, const bool alldesktops, const bool sameclass, @@ -613,15 +612,15 @@ void screen::cycleWindow(unsigned int state, const bool forward, for (int x = 0; x < increment; ++x) { while (1) { if (forward) { - if (target == end) { + if (target == end) target = begin; - } else { + else ++target; - } } else { if (target == begin) target = end; - --target; + else + --target; } // must be no window to focus -- 2.34.1