7#include <QtWaylandCompositor/QWaylandSeat>
8#include <QtWaylandCompositor/QWaylandCompositor>
10#include <QtWaylandCompositor/private/qwaylandsurface_p.h>
11#include <QtWaylandCompositor/private/qwaylandoutput_p.h>
13#include <QtCore/QMutex>
24 emit q->surfaceDestroyed();
83 return d->renderObject;
137 if (
d->surface == newSurface)
140 d->setSurface(newSurface);
141 d->clearFrontBuffer();
165 if (
d->output == newOutput)
168 if (
d->output &&
d->surface)
171 d->output = newOutput;
173 if (
d->output &&
d->surface)
192 d->nextDamage = damage;
193 d->nextBufferCommitted =
true;
207 if (!
d->nextBufferCommitted && !
d->forceAdvanceSucceed)
213 if (
d->surface &&
d->surface->primaryView() ==
this) {
214 const auto views =
d->surface->views();
216 if (
view !=
this &&
view->allowDiscardFrontBuffer() &&
view->d_func()->currentBuffer ==
d->currentBuffer)
217 view->discardCurrentBuffer();
222 d->forceAdvanceSucceed =
false;
223 d->nextBufferCommitted =
false;
224 d->currentBuffer =
d->nextBuffer;
225 d->currentDamage =
d->nextDamage;
237 d->forceAdvanceSucceed =
true;
247 return d->currentBuffer;
257 return d->currentDamage;
282 return d->bufferLocked;
288 if (
d->bufferLocked == locked)
290 d->bufferLocked = locked;
315 return d->allowDiscardFrontBuffer;
321 if (
d->allowDiscardFrontBuffer == discard)
323 d->allowDiscardFrontBuffer = discard;
338 d->surface->setPrimaryView(
this);
340 qWarning(
"Calling setPrimary() on a QWaylandView without a surface has no effect.");
351 return d->surface &&
d->surface->primaryView() ==
this;
362 return d->surface->resource();
367#include "moc_qwaylandview.cpp"
bool isNull() const
Returns true if the referenced object has been destroyed or if there is no referenced object; otherwi...
The QRegion class specifies a clip region for a painter.
\inmodule QtWaylandCompositor
void removeView(QWaylandView *view, QWaylandSurface *surface)
void addView(QWaylandView *view, QWaylandSurface *surface)
static QWaylandOutputPrivate * get(QWaylandOutput *output)
\qmltype WaylandOutput \instantiates QWaylandOutput \inqmlmodule QtWayland.Compositor
static QWaylandSurfacePrivate * get(QWaylandSurface *surface)
void refView(QWaylandView *view)
void derefView(QWaylandView *view)
\qmltype WaylandSurface \instantiates QWaylandSurface \inqmlmodule QtWayland.Compositor
void setSurface(QWaylandSurface *newSurface)
QWaylandSurface * surface
QWaylandBufferRef nextBuffer
QWaylandBufferRef currentBuffer
void markSurfaceAsDestroyed(QWaylandSurface *surface)
\qmltype WaylandView \instantiates QWaylandView \inqmlmodule QtWayland.Compositor
virtual bool advance()
Updates the current buffer and damage region to the latest version committed by the client.
virtual void discardCurrentBuffer()
Force the view to discard its current buffer, to allow it to be reused on the client side.
virtual QRegion currentDamage()
Returns the current damage region of this view.
bool isBufferLocked() const
struct wl_resource * surfaceResource() const
Returns the Wayland surface resource for this QWaylandView.
void allowDiscardFrontBufferChanged()
bool isPrimary() const
Returns true if this QWaylandView is the primary view for the QWaylandSurface.
QWaylandOutput * output
\qmlproperty WaylandOutput QtWayland.Compositor::WaylandView::output
void setSurface(QWaylandSurface *surface)
QWaylandView(QObject *renderObject=nullptr, QObject *parent=nullptr)
Constructs a QWaylandView with the given renderObject and parent.
bool allowDiscardFrontBuffer
\qmlproperty bool QtWayland.Compositor::WaylandView::allowDiscardFrontBuffer
virtual QWaylandBufferRef currentBuffer()
Returns a reference to this view's current buffer.
void setOutput(QWaylandOutput *output)
QWaylandSurface * surface
\qmlproperty WaylandSurface QtWayland.Compositor::WaylandView::surface
void bufferLockedChanged()
~QWaylandView() override
Destroys the QWaylandView.
virtual void bufferCommitted(const QWaylandBufferRef &buffer, const QRegion &damage)
This function is called when a new buffer is committed to this view's surface.
void setPrimary()
Makes this QWaylandView the primary view for the surface.
void setAllowDiscardFrontBuffer(bool discard)
void setBufferLocked(bool locked)
Combined button and popup list for selecting options.
GLdouble GLdouble GLdouble GLdouble q
IUIAutomationTreeWalker __RPC__deref_out_opt IUIAutomationElement ** parent