diff options
Diffstat (limited to 'src/compositor/compositor_api/qwaylandview.cpp')
-rw-r--r-- | src/compositor/compositor_api/qwaylandview.cpp | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/compositor/compositor_api/qwaylandview.cpp b/src/compositor/compositor_api/qwaylandview.cpp index 4970de26f..f83948302 100644 --- a/src/compositor/compositor_api/qwaylandview.cpp +++ b/src/compositor/compositor_api/qwaylandview.cpp @@ -53,8 +53,8 @@ void QWaylandViewPrivate::markSurfaceAsDestroyed(QWaylandSurface *surface) Q_Q(QWaylandView); Q_ASSERT(surface == this->surface); - q->waylandSurfaceDestroyed(); q->setSurface(Q_NULLPTR); + q->waylandSurfaceDestroyed(); } QWaylandView::QWaylandView() @@ -86,6 +86,12 @@ QWaylandSurface *QWaylandView::surface() const void QWaylandView::setSurface(QWaylandSurface *newSurface) { Q_D(QWaylandView); + if (d->surface == newSurface) + return; + + if (!d->output && newSurface && !d->surface) + setOutput(newSurface->primaryOutput()); + QWaylandSurface *oldSurface = d->surface; d->surface = newSurface; |