lastfocus = (OpenboxWindow *) 0;
name = (char *) 0;
- char *tmp = screen.getNameOfWorkspace(id);
- setName(tmp);
+ setName(screen.getNameOfWorkspace(id));
}
if (w->isTransient() && w->getTransientFor() &&
w->getTransientFor()->isVisible()) {
w->getTransientFor()->setInputFocus();
- } else if (screen.sloppyFocus()) {
- screen.getOpenbox().focusWindow((OpenboxWindow *) 0);
} else {
- if (_zorder.empty() || !_zorder.front()->setInputFocus()) {
+ if (screen.sloppyFocus() || // sloppy focus
+ _zorder.empty() || // click focus but no windows
+ !_zorder.front()->setInputFocus()) { // tried window, but wont focus
screen.getOpenbox().focusWindow((OpenboxWindow *) 0);
- XSetInputFocus(screen.getOpenbox().getXDisplay(),
- screen.getToolbar()->getWindowID(),
- RevertToParent, CurrentTime);
}
}
}
}
-void Workspace::setName(char *new_name) {
+void Workspace::setName(const char *new_name) {
if (name)
delete [] name;
void Workspace::shutdown(void) {
- while (!_windows.empty()) {
+ while (!_windows.empty())
_windows[0]->restore();
- _windows.erase(_windows.begin());
- }
}
static rectList calcSpace(const Rect &win, const rectList &spaces) {
spaces.push_back(space); //initially the entire screen is free
//Find Free Spaces
- for (winVect::iterator it = _windows.begin(); it != _windows.end(); ++it)
+ winVect::iterator it;
+ for (it = _windows.begin(); it != _windows.end(); ++it)
spaces = calcSpace((*it)->area().Inflate(screen.getBorderWidth() * 4),
spaces);
spaces.push_back(space); //initially the entire screen is free
//Find Free Spaces
- for (winVect::iterator it = _windows.begin(); it != _windows.end(); ++it)
+ winVect::iterator it;
+ for (it = _windows.begin(); it != _windows.end(); ++it)
spaces = calcSpace((*it)->area().Inflate(screen.getBorderWidth() * 4),
spaces);
//Sort spaces by preference
spaces.push_back(space); //initially the entire screen is free
//Find Free Spaces
- for (winVect::iterator it = _windows.begin(); it != _windows.end(); ++it)
+ winVect::iterator it;
+ for (it = _windows.begin(); it != _windows.end(); ++it)
spaces = calcSpace((*it)->area().Inflate(screen.getBorderWidth() * 4),
spaces);
//Sort spaces by user preference