]> Dogcows Code - chaz/openbox/commitdiff
find modal children and focus them
authorDana Jansens <danakj@orodu.net>
Mon, 3 Feb 2003 08:51:44 +0000 (08:51 +0000)
committerDana Jansens <danakj@orodu.net>
Mon, 3 Feb 2003 08:51:44 +0000 (08:51 +0000)
src/client.cc

index 296e2e52d32725d0451af8bd47045170b25fb623..2f8cfe8d7efb7dfb769c3e5cfeebc7f879824a1f 100644 (file)
@@ -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;
 }
 
This page took 0.02616 seconds and 4 git commands to generate.