]> Dogcows Code - chaz/openbox/blobdiff - src/client.cc
set the desktop number before the number of desktops
[chaz/openbox] / src / client.cc
index 08feae3e9f918b59f7834df0fee86e27be05feab..2f8cfe8d7efb7dfb769c3e5cfeebc7f879824a1f 100644 (file)
@@ -679,8 +679,6 @@ void Client::updateTransientFor()
     _transient_for = c;
     if (_transient_for)
       _transient_for->_transients.push_back(this); // add to new parent
-
-    // XXX: change decor status?
   }
 }
 
@@ -841,7 +839,6 @@ void Client::setState(StateAction action, long data1, long data2)
       } else if (state == otk::Property::atoms.net_wm_state_maximized_horz) {
         if (_max_horz) continue;
         maxh = true;
-        // XXX: resize the window etc
       } else if (state == otk::Property::atoms.net_wm_state_shaded) {
         shadestate = true;
       } else if (state == otk::Property::atoms.net_wm_state_skip_taskbar) {
@@ -1551,6 +1548,21 @@ void Client::disableDecorations(DecorationFlags flags)
 }
 
 
+bool Client::focusModalChild()
+{
+  // 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;
+}
+
+
 bool Client::focus()
 {
   // won't try focus if the client doesn't want it, or if the window isn't
@@ -1559,6 +1571,10 @@ bool Client::focus()
 
   if (_focused) return true;
 
+  if (!_modal)
+    if (focusModalChild())
+      return true;
+
   // do a check to see if the window has already been unmapped or destroyed
   // do this intelligently while watching out for unmaps we've generated
   // (ignore_unmaps > 0)
This page took 0.023802 seconds and 4 git commands to generate.