diff options
| author | Dana Jansens <danakj@orodu.net> | 2003-01-04 08:41:42 +0000 |
|---|---|---|
| committer | Dana Jansens <danakj@orodu.net> | 2003-01-04 08:41:42 +0000 |
| commit | 056ff3b50cddd39b6f45969c17611dc3bf396ae9 (patch) | |
| tree | f91ec562c11d9a4ae0a41f963b82ae1c37300df8 /src/screen.cc | |
| parent | ee1130f8ecd9ddc94eca535fa129809d840b8219 (diff) | |
better focus passing around for now
Diffstat (limited to 'src/screen.cc')
| -rw-r--r-- | src/screen.cc | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/src/screen.cc b/src/screen.cc index bebc82d1..d9067aa0 100644 --- a/src/screen.cc +++ b/src/screen.cc @@ -518,6 +518,9 @@ void OBScreen::manageWindow(Window window) setClientList(); Openbox::instance->bindings()->grabButtons(true, client); + + // XXX: make this optional or more intelligent + client->focus(); } @@ -533,9 +536,13 @@ void OBScreen::unmanageWindow(OBClient *client) // pass around focus if this window was focused XXX do this better! if (Openbox::instance->focusedClient() == client) { OBClient *newfocus = 0; - if (!_stacking.empty()) - newfocus = _stacking.front(); - if (! (newfocus && newfocus->focus())) + ClientList::iterator it, end = _stacking.end(); + for (it = _stacking.begin(); it != end; ++it) + if ((*it)->normal() && (*it)->focus()) { + newfocus = *it; + break; + } + if (!newfocus) client->unfocus(); } |
