_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;
// 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
}
}
_active = it;
- _last_active = it;
+ if (it != end)
+ _last_active = it;
/* cout << "Active window is now: ";
if (_active == _clients.end()) cout << "None\n";
}
-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;
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));