From kde-core-devel Wed May 31 00:59:27 2000 From: Michael Matz Date: Wed, 31 May 2000 00:59:27 +0000 To: kde-core-devel Subject: Re: Kwin freezes X-MARC-Message: https://marc.info/?l=kde-core-devel&m=95973487215477 Hi, On Tue, 30 May 2000, Rik Hemsley wrote: > if (!block_focus && > options->focusPolicyIsReasonable() && > !focus_chain.isEmpty()) > { > ClientList::ConstIterator it = focus_chain.fromLast(); > do { > if ((*it)->isVisible()) { > requestFocus(*it); > break; > } > it--; > } while (it != focus_chain.begin()); > } This breaks the loop, if (it==focus_chain.begin()), but before evaluating begin(). Note that begin() is (unlike end()) an element of the list. Use something like for(it=bla.fromLast();it!=bla.end(); --it) {} I think the Qt docu is wrong in saying, that --begin() is undefined, as then there would be no nice way to recurse backwards. And indeed the reality is another, --begin()==end(). (At least as I last looked at all the loops in kwin) Ciao, Michael.