From: Dana Jansens Date: Mon, 3 Feb 2003 08:51:44 +0000 (+0000) Subject: find modal children and focus them X-Git-Url: https://git.brokenzipper.com/gitweb?a=commitdiff_plain;h=6cc8d62e2674bd8bcb0d83935337523ca486098f;p=chaz%2Fopenbox find modal children and focus them --- diff --git a/src/client.cc b/src/client.cc index 296e2e52..2f8cfe8d 100644 --- a/src/client.cc +++ b/src/client.cc @@ -1550,7 +1550,15 @@ void Client::disableDecorations(DecorationFlags flags) bool Client::focusModalChild() { - // XXX: find a modal child recursively and try focus it + // find a modal child recursively and try focus it + List::iterator it, end = _transients.end(); + for (it = _transients.begin(); it != end; ++it) + if ((*it)->focusModalChild()) + return true; // got one + // none of our grand-children are modal, try our direct children + for (it = _transients.begin(); it != end; ++it) + if ((*it)->modal() && (*it)->focus()) + return true; // got one return false; }