Avoid calling requestUpdate from wrong thread
In certain circumstances, we can get to createDecoration() from the render thread (from QWaylandGLContext::makeCurrent) Calling requestUpdate() from this secondary thread would cause an assert, so we queue the call on the appropriate thread instead. This amends 1a2e499e0e05a03460f4335d5266be485f97d3fa. Pick-to: 5.15 6.2 6.3 6.3.2 6.4 Fixes: QTBUG-105308 Change-Id: I4805265f39e24eb1464897532be2025bc3c27728 Reviewed-by: Inho Lee <inho.lee@qt.io>
This commit is contained in:
parent
4132a63f14
commit
6f8b1bd725
@ -932,7 +932,11 @@ 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.
|
||||
window()->requestUpdate();
|
||||
// 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);
|
||||
}
|
||||
|
||||
return mWindowDecoration;
|
||||
|
Loading…
x
Reference in New Issue
Block a user