From 056ff3b50cddd39b6f45969c17611dc3bf396ae9 Mon Sep 17 00:00:00 2001 From: Dana Jansens Date: Sat, 4 Jan 2003 08:41:42 +0000 Subject: better focus passing around for now --- src/screen.cc | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'src/screen.cc') 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(); } -- cgit v1.2.3