summaryrefslogtreecommitdiffstats
path: root/src/gui/kernel/qwindow.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui/kernel/qwindow.cpp')
-rw-r--r--src/gui/kernel/qwindow.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/gui/kernel/qwindow.cpp b/src/gui/kernel/qwindow.cpp
index 93edfe63313..5a27b191010 100644
--- a/src/gui/kernel/qwindow.cpp
+++ b/src/gui/kernel/qwindow.cpp
@@ -1300,8 +1300,13 @@ bool QWindow::isAncestorOf(const QWindow *child, AncestorMode mode) const
if (child->parent() == this || (mode == IncludeTransients && child->transientParent() == this))
return true;
- if (child->parent(mode) && isAncestorOf(child->parent(mode), mode))
- return true;
+ if (QWindow *parent = child->parent(mode)) {
+ if (isAncestorOf(parent, mode))
+ return true;
+ } else if (handle() && child->handle()) {
+ if (handle()->isAncestorOf(child->handle()))
+ return true;
+ }
return false;
}