summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBernd Weimer <bernd.weimer@qt.io>2022-01-26 16:54:11 +0100
committerQt Cherry-pick Bot <cherrypick_bot@qt-project.org>2022-02-15 10:37:36 +0000
commit7736e97091576f5d87877e6458e31e4c95855ed2 (patch)
tree4f0dd5166b7698fef8e43bb2b836168291de88d1
parent3e1b87b4e274c55e4fd733376e5a1ed1fbf476e6 (diff)
downloadqtwayland-7736e97091576f5d87877e6458e31e4c95855ed2.tar.gz
Call updateSize only for new windows
This avoids "No update on item size as the buffer is currently locked" warnings when windows are hold in a model and a window is closed and removed from the model. The problem was apparent in many QtApplicationManager examples. Change-Id: Icb9d4cd37d3a4a8ee4214a92aed8422794729d9d Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io> (cherry picked from commit 074ac72067b86420904e350b01db374de706a064) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
-rw-r--r--src/compositor/compositor_api/qwaylandquickitem.cpp14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/compositor/compositor_api/qwaylandquickitem.cpp b/src/compositor/compositor_api/qwaylandquickitem.cpp
index 7e1227db..c00b904e 100644
--- a/src/compositor/compositor_api/qwaylandquickitem.cpp
+++ b/src/compositor/compositor_api/qwaylandquickitem.cpp
@@ -1369,15 +1369,15 @@ void QWaylandQuickItem::updateWindow()
if (d->connectedWindow) {
connect(d->connectedWindow, &QQuickWindow::beforeSynchronizing, this, &QWaylandQuickItem::beforeSync, Qt::DirectConnection);
connect(d->connectedWindow, &QQuickWindow::screenChanged, this, &QWaylandQuickItem::updateSize); // new screen may have new dpr
- }
- if (compositor() && d->connectedWindow) {
- QWaylandOutput *output = compositor()->outputFor(d->connectedWindow);
- Q_ASSERT(output);
- d->view->setOutput(output);
- }
+ if (compositor()) {
+ QWaylandOutput *output = compositor()->outputFor(d->connectedWindow);
+ Q_ASSERT(output);
+ d->view->setOutput(output);
+ }
- updateSize(); // because scaleFactor depends on devicePixelRatio, which may be different for the new window
+ updateSize(); // because scaleFactor depends on devicePixelRatio, which may be different for the new window
+ }
}
void QWaylandQuickItem::updateOutput()