summaryrefslogtreecommitdiff
path: root/src/client.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/client.cc')
-rw-r--r--src/client.cc3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/client.cc b/src/client.cc
index d5be00d0..e78336d3 100644
--- a/src/client.cc
+++ b/src/client.cc
@@ -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;
}
}