X-Git-Url: https://git.brokenzipper.com/gitweb?a=blobdiff_plain;f=util%2Fepist%2Fscreen.cc;h=281a093e3aa10745bee6978eb301b5a6b6302670;hb=49c04eaf57fc20efe95c431b78b2c08d6403dee2;hp=56f64f0cee662665269a9a5bde374525eee56397;hpb=28594da6de001f1d8b6b975286032302db3a6491;p=chaz%2Fopenbox diff --git a/util/epist/screen.cc b/util/epist/screen.cc index 56f64f0c..281a093e 100644 --- a/util/epist/screen.cc +++ b/util/epist/screen.cc @@ -60,9 +60,6 @@ screen::screen(epist *epist, int number) _info = _epist->getScreenInfo(_number); _root = _info->getRootWindow(); - cout << "root window on screen " << _number << ": 0x" << hex << _root << - dec << endl; - // find a window manager supporting NETWM, waiting for it to load if we must int count = 20; // try for 20 seconds _managed = false; @@ -421,7 +418,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 +442,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"; @@ -453,7 +452,7 @@ void screen::updateActiveWindow() { } -void screen::execCommand(const std::string &cmd) const { +void screen::execCommand(const string &cmd) const { pid_t pid; if ((pid = fork()) == 0) { extern char **environ; @@ -514,7 +513,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));