diff --git a/src/plugins/platforms/wayland/qwaylandshmbackingstore.cpp b/src/plugins/platforms/wayland/qwaylandshmbackingstore.cpp index ffd17ce89fe..fc5e7822104 100644 --- a/src/plugins/platforms/wayland/qwaylandshmbackingstore.cpp +++ b/src/plugins/platforms/wayland/qwaylandshmbackingstore.cpp @@ -204,7 +204,6 @@ void QWaylandShmBackingStore::endPaint() void QWaylandShmBackingStore::ensureSize() { waylandWindow()->setBackingStore(this); - waylandWindow()->createDecoration(); resize(mRequestedSize); } diff --git a/src/plugins/platforms/wayland/qwaylandwindow.cpp b/src/plugins/platforms/wayland/qwaylandwindow.cpp index b34e448b67a..672ddc5b169 100644 --- a/src/plugins/platforms/wayland/qwaylandwindow.cpp +++ b/src/plugins/platforms/wayland/qwaylandwindow.cpp @@ -1041,6 +1041,8 @@ void QWaylandWindow::setWindowFlags(Qt::WindowFlags flags) bool QWaylandWindow::createDecoration() { + Q_ASSERT_X(QThread::currentThreadId() == QThreadData::get2(thread())->threadId.loadRelaxed(), + "QWaylandWindow::createDecoration", "not called from main thread"); if (!mDisplay->supportsWindowDecoration()) return false; @@ -1121,11 +1123,7 @@ bool QWaylandWindow::createDecoration() // size and are not redrawn, leaving the new buffer empty. As a simple // work-around, we trigger a full extra update whenever the client-side // window decorations are toggled while the window is showing. - // Note: createDecoration() is sometimes called from the render thread - // of Qt Quick. This is essentially wrong and could potentially cause problems, - // but until the underlying issue has been fixed, we have to use invokeMethod() - // here to avoid asserts. - QMetaObject::invokeMethod(window(), &QWindow::requestUpdate); + window()->requestUpdate(); } return mWindowDecoration;