110 QWaylandSurfacePrivate::get(surface)->derefView(q);
112 QWaylandOutputPrivate::get(output)->removeView(q, surface);
117 nextBuffer = QWaylandBufferRef();
119 nextDamage = QRegion();
123 QWaylandSurfacePrivate::get(surface)->refView(q);
125 QWaylandOutputPrivate::get(output)->addView(q, surface);
165void QWaylandView::setOutput(QWaylandOutput *newOutput)
168 if (d->output == newOutput)
171 if (d->output && d->surface)
172 QWaylandOutputPrivate::get(d->output)->removeView(
this, d->surface);
174 d->output = newOutput;
176 if (d->output && d->surface)
177 QWaylandOutputPrivate::get(d->output)->addView(
this, d->surface);
179 emit outputChanged();
206bool QWaylandView::advance()
210 if (!d->nextBufferCommitted && !d->forceAdvanceSucceed)
216 if (d->surface && d->surface->primaryView() ==
this) {
217 const auto views = d->surface->views();
218 for (QWaylandView *view : views) {
219 if (view !=
this && view->allowDiscardFrontBuffer() && view->d_func()->currentBuffer == d->currentBuffer)
220 view->discardCurrentBuffer();
224 QMutexLocker locker(&d->bufferMutex);
225 d->forceAdvanceSucceed =
false;
226 d->nextBufferCommitted =
false;
227 d->currentBuffer = std::exchange(d->nextBuffer, {});
228 d->currentDamage = std::exchange(d->nextDamage, {});