X-Git-Url: https://git.brokenzipper.com/gitweb?a=blobdiff_plain;ds=sidebyside;f=util%2Fepist%2Fscreen.cc;h=2c1da1ae53054e2c26c4b68ad7aa03ff47dfd8dc;hb=ae86775d0495dc906d1bdf1b9ed4fbfbbd378615;hp=2a4d5a7078fc06a19da7cdb50d1c8c1a2fb9c240;hpb=8e38989ee8533c364a7f407bdafef351d9f1823e;p=chaz%2Fopenbox diff --git a/util/epist/screen.cc b/util/epist/screen.cc index 2a4d5a70..2c1da1ae 100644 --- a/util/epist/screen.cc +++ b/util/epist/screen.cc @@ -421,7 +421,8 @@ const XWindow *screen::lastActiveWindow() const { // find a window if one exists WindowList::const_iterator it, end = _clients.end(); for (it = _clients.begin(); it != end; ++it) - if ((*it)->getScreen() == this) + if ((*it)->getScreen() == this && ! (*it)->iconic() && + ((*it)->desktop() == 0xffffffff || (*it)->desktop() == _active_desktop)) return *it; // no windows on this screen @@ -444,7 +445,8 @@ void screen::updateActiveWindow() { } } _active = it; - _last_active = it; + if (it != end) + _last_active = it; /* cout << "Active window is now: "; if (_active == _clients.end()) cout << "None\n"; @@ -514,7 +516,9 @@ void screen::cycleWindow(const bool forward, const bool allscreens, return; } while ((*target)->iconic() || (! allscreens && (*target)->getScreen() != this) || - (! alldesktops && (*target)->desktop() != _active_desktop) || + (! alldesktops && + (*target)->desktop() != _active_desktop && + (*target)->desktop() != 0xffffffff) || (sameclass && ! classname.empty() && (*target)->appClass() != classname));