93 QWaylandSurfacePrivate::get(surface)->derefView(q);
95 QWaylandOutputPrivate::get(output)->removeView(q, surface);
100 nextBuffer = QWaylandBufferRef();
102 nextDamage = QRegion();
106 QWaylandSurfacePrivate::get(surface)->refView(q);
108 QWaylandOutputPrivate::get(output)->addView(q, surface);
142void QWaylandView::setOutput(QWaylandOutput *newOutput)
145 if (d->output == newOutput)
148 if (d->output && d->surface)
149 QWaylandOutputPrivate::get(d->output)->removeView(
this, d->surface);
151 d->output = newOutput;
153 if (d->output && d->surface)
154 QWaylandOutputPrivate::get(d->output)->addView(
this, d->surface);
156 emit outputChanged();
183bool QWaylandView::advance()
187 if (!d->nextBufferCommitted && !d->forceAdvanceSucceed)
193 if (d->surface && d->surface->primaryView() ==
this) {
194 const auto views = d->surface->views();
195 for (QWaylandView *view : views) {
196 if (view !=
this && view->allowDiscardFrontBuffer() && view->d_func()->currentBuffer == d->currentBuffer)
197 view->discardCurrentBuffer();
201 QMutexLocker locker(&d->bufferMutex);
202 d->forceAdvanceSucceed =
false;
203 d->nextBufferCommitted =
false;
204 d->currentBuffer = std::exchange(d->nextBuffer, {});
205 d->currentDamage = std::exchange(d->nextDamage, {});