summaryrefslogtreecommitdiffstats
path: root/src/gui/kernel/qguiapplication.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui/kernel/qguiapplication.cpp')
-rw-r--r--src/gui/kernel/qguiapplication.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/gui/kernel/qguiapplication.cpp b/src/gui/kernel/qguiapplication.cpp
index 85297dda1c..5f4cbce73b 100644
--- a/src/gui/kernel/qguiapplication.cpp
+++ b/src/gui/kernel/qguiapplication.cpp
@@ -604,8 +604,13 @@ QWindowList QGuiApplication::topLevelWindows()
const QWindowList &list = QGuiApplicationPrivate::window_list;
QWindowList topLevelWindows;
for (int i = 0; i < list.size(); i++) {
- if (!list.at(i)->parent())
- topLevelWindows.prepend(list.at(i));
+ if (!list.at(i)->parent()) {
+ // Top windows of embedded QAxServers do not have QWindow parents,
+ // but they are not true top level windows, so do not include them.
+ const bool embedded = list.at(i)->handle() && list.at(i)->handle()->isEmbedded(0);
+ if (!embedded)
+ topLevelWindows.prepend(list.at(i));
+ }
}
return topLevelWindows;
}