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.
wilder/Plasma/6.2
Vlad Zahorodnii 2 years ago
parent 601d33f294
commit 35572904fc
  1. 2
      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);
}

Loading…
Cancel
Save