]> Dogcows Code - chaz/openbox/blobdiff - src/client.cc
remove includes for widgetbase.hh. fix bug with circular modal pointer.
[chaz/openbox] / src / client.cc
index d5be00d01822b8b64f7796180eeea9f0035dfda0..e78336d3966b50bd152668685a5c67c018af8dbc 100644 (file)
@@ -821,6 +821,7 @@ void Client::setModal(bool modal)
     Client *c = this;
     while (c->_transient_for) {
       c = c->_transient_for;
+      if (c == this) break; // circular?
       if (c->_modal_child) break; // already has a modal child
       c->_modal_child = this;
     }
@@ -836,7 +837,9 @@ void Client::setModal(bool modal)
     c = this;
     while (c->_transient_for) {
       c = c->_transient_for;
+      if (c == this) break; // circular?
       if (c->_modal_child != this) break; // has a different modal child
+      if (c == replacement) break; // found the replacement itself
       c->_modal_child = replacement;
     }
   }
This page took 0.022264 seconds and 4 git commands to generate.