Make QWasmScreen::allWindows return all (wasm) windows
It seems that findChildren does not return every window if called at an inconvenient time. This causes not all windows to be returned, and later the QWasmCompositor will not detect a valid window to compose, and therefor goes to disabled. Fixes: QTBUG-132414 Pick-to: 6.9 Change-Id: I6c872071751d5a2fbdeea36fb8f4c7e9677fd7d0 Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
This commit is contained in:
parent
23c16c611c
commit
5c5844cedb
@ -330,21 +330,26 @@ QWasmWindowTreeNode *QWasmScreen::parentNode()
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
QList<QWasmWindow *> QWasmScreen::allWindows()
|
||||
QList<QWasmWindow *> QWasmScreen::allWindows() const
|
||||
{
|
||||
QList<QWasmWindow *> windows;
|
||||
for (auto *child : childStack()) {
|
||||
const QWindowList list = child->window()->findChildren<QWindow *>(Qt::FindChildrenRecursively);
|
||||
for (auto child : list) {
|
||||
auto handle = child->handle();
|
||||
if (handle) {
|
||||
auto wnd = static_cast<QWasmWindow *>(handle);
|
||||
windows.push_back(wnd);
|
||||
}
|
||||
QList<QWasmWindow *> currentChildren;
|
||||
QList<QWasmWindow *> result;
|
||||
|
||||
for (auto *w : childStack())
|
||||
currentChildren << w;
|
||||
|
||||
while (!currentChildren.empty()) {
|
||||
result << currentChildren;
|
||||
|
||||
QList<QWasmWindow *> toIterate;
|
||||
currentChildren.swap(toIterate);
|
||||
|
||||
for (auto child : toIterate) {
|
||||
for (auto *w : child->childStack())
|
||||
currentChildren << w;
|
||||
}
|
||||
windows.push_back(child);
|
||||
}
|
||||
return windows;
|
||||
return result;
|
||||
}
|
||||
|
||||
QT_END_NAMESPACE
|
||||
|
@ -43,7 +43,7 @@ public:
|
||||
QWasmCompositor *compositor();
|
||||
QWasmDeadKeySupport *deadKeySupport() { return m_deadKeySupport.get(); }
|
||||
|
||||
QList<QWasmWindow *> allWindows();
|
||||
QList<QWasmWindow *> allWindows() const;
|
||||
|
||||
QRect geometry() const override;
|
||||
int depth() const override;
|
||||
|
Loading…
x
Reference in New Issue
Block a user