]> Dogcows Code - chaz/openbox/blobdiff - src/client.cc
set the desktop number before the number of desktops
[chaz/openbox] / src / client.cc
index 83ee5b9a22e379a15652929ae607e82547e93e22..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;
 }
 
@@ -1563,7 +1571,7 @@ bool Client::focus()
 
   if (_focused) return true;
 
-  if (_modal)
+  if (!_modal)
     if (focusModalChild())
       return true;
 
This page took 0.020185 seconds and 4 git commands to generate.