From 35572904fcaa9183e15c5bebade9802dfa7d0cb9 Mon Sep 17 00:00:00 2001 From: Vlad Zahorodnii Date: Thu, 25 Jan 2024 12:22:13 +0200 Subject: [PATCH] effect: Overwrite the output in OffscreenQuickView::setGeometry() It seems like QWindow::setGeometry() won't update the associated output if no platform window has been created, which is the case when running overview or any other qml effect. It's not clear whether this is a Qt bug or intended behavior. qwindow.cpp contains comments assuming that the window is on the primary output if no platform window exists. --- src/effect/offscreenquickview.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/effect/offscreenquickview.cpp b/src/effect/offscreenquickview.cpp index bb9b67ddc5..03d9960b2a 100644 --- a/src/effect/offscreenquickview.cpp +++ b/src/effect/offscreenquickview.cpp @@ -447,6 +447,8 @@ void OffscreenQuickView::setGeometry(const QRect &rect) { const QRect oldGeometry = d->m_view->geometry(); d->m_view->setGeometry(rect); + // QWindow::setGeometry() won't sync output if there's no platform window. + d->m_view->setScreen(QGuiApplication::screenAt(rect.center())); Q_EMIT geometryChanged(oldGeometry, rect); }