9#include <QtWaylandCompositor/QWaylandView>
10#include <QtWaylandCompositor/QWaylandQuickItem>
86 qWarning() <<
"QWaylandPresentationTime is already initialized";
91 if (compositor ==
nullptr) {
92 qWarning() <<
"Failed to find QWaylandCompositor when initializing QWaylandPresentationTime";
126 quint32 refresh_nsec =
window->screen()->refreshRate() != 0 ? 1000000000 /
window->screen()->refreshRate() : 0;
136 return QWaylandPresentationTimePrivate::interface();
144 return QWaylandPresentationTimePrivate::interfaceName();
148 : wp_presentation_feedback(client,
id, version)
149 , m_presentationTime(pTime)
173 maybeConnectToWindow(
view);
176void PresentationFeedback::onSurfaceCommit()
186void PresentationFeedback::onSurfaceMapped()
190 qWarning() <<
"The mapped surface has no view";
195 maybeConnectToWindow(
view);
202 qWarning() <<
"QWaylandPresentationTime only works with QtQuick compositors" <<
view;
207 connect(
item, &QQuickItem::windowChanged,
this, &PresentationFeedback::onWindowChanged);
216void PresentationFeedback::onWindowChanged()
222 qWarning() <<
"QWaylandPresentationTime only works with QtQuick compositors" <<
item;
247 connect(
window, &QQuickWindow::afterFrameEnd,
this, &PresentationFeedback::onSwapped);
250void PresentationFeedback::onSync()
261void PresentationFeedback::onSwapped()
266 disconnect(
window, &QQuickWindow::afterFrameEnd,
this, &PresentationFeedback::onSwapped);
271void PresentationFeedback::discard()
281 qWarning() <<
"No compositor container to send sync_output";
297 send_presented(tv_sec >> 32, tv_sec, tv_nsec, refresh_nsec, sequence >> 32, sequence,
298 QtWaylandServer::wp_presentation_feedback::kind_vsync
299 | QtWaylandServer::wp_presentation_feedback::kind_hw_clock
300 | QtWaylandServer::wp_presentation_feedback::kind_hw_completion);
307 wl_resource_destroy(resource()->
handle);
322 send_clock_id(resource->handle, CLOCK_MONOTONIC);
338#include "moc_qwaylandpresentationtime_p_p.cpp"
340#include "moc_qwaylandpresentationtime_p.cpp"
void setSurface(QWaylandSurface *)
void wp_presentation_feedback_destroy_resource(Resource *resource) override
QWaylandSurface * surface()
QWaylandPresentationTime * m_presentationTime
PresentationFeedback(QWaylandPresentationTime *, QWaylandSurface *, struct ::wl_client *, uint32_t, int)
QWaylandSurface * m_surface
QQuickWindow * m_connectedWindow
QGraphicsWidget * window() const
static QMetaObject::Connection connect(const QObject *sender, const char *signal, const QObject *receiver, const char *member, Qt::ConnectionType=Qt::AutoConnection)
\threadsafe
QObject * sender() const
Returns a pointer to the object that sent the signal, if called in a slot activated by a signal; othe...
static bool disconnect(const QObject *sender, const char *signal, const QObject *receiver, const char *member)
\threadsafe
void destroyed(QObject *=nullptr)
This signal is emitted immediately before the object obj is destroyed, after any instances of QPointe...
\qmltype Window \instantiates QQuickWindow \inqmlmodule QtQuick
void beforeSynchronizing()
This signal is emitted before the scene graph is synchronized with the QML state.
static QWaylandClient * fromWlClient(QWaylandCompositor *compositor, wl_client *wlClient)
Returns the QWaylandClient corresponding to the Wayland client wlClient and compositor.
\inmodule QtWaylandCompositor
virtual void initialize()
Initializes the QWaylandCompositorExtension.
bool isInitialized() const
QWaylandObject * extensionContainer() const
\qmltype WaylandCompositor \instantiates QWaylandCompositor \inqmlmodule QtWayland....
\qmltype WaylandOutput \instantiates QWaylandOutput \inqmlmodule QtWayland.Compositor
void wp_presentation_bind_resource(Resource *resource) override
void wp_presentation_feedback(Resource *resource, struct ::wl_resource *surface, uint32_t callback) override
QWaylandPresentationTimePrivate()
\qmltype PresentationTime \instantiates QWaylandPresentationTime \inqmlmodule QtWayland....
QWaylandPresentationTime()
Constructs an empty QWaylandPresentationTime object.
void initialize() override
Initializes the extension.
static const struct wl_interface * interface()
Returns the Wayland interface for the QWaylandPresentationTime.
QWaylandCompositor * compositor() const
Q_INVOKABLE void sendFeedback(QQuickWindow *window, quint64 sequence, quint64 tv_sec, quint32 tv_nsec)
\qmlmethod void PresentationTime::sendFeedback(Window window, int sequence, int sec,...
void presented(quint64 sequence, quint64 tv_sec, quint32 tv_nsec, quint32 refresh_nsec)
static QByteArray interfaceName()
\qmltype WaylandQuickItem \instantiates QWaylandQuickItem \inqmlmodule QtWayland.Compositor
\qmltype WaylandSurface \instantiates QWaylandSurface \inqmlmodule QtWayland.Compositor
static QWaylandSurface * fromResource(::wl_resource *resource)
Returns the QWaylandSurface corresponding to the Wayland resource resource.
QWaylandClient * client
\qmlproperty WaylandClient QtWayland.Compositor::WaylandSurface::client
QWaylandView * primaryView() const
Updates the surface with the compositor's retained clipboard selection.
void damaged(const QRegion &rect)
\qmltype WaylandView \instantiates QWaylandView \inqmlmodule QtWayland.Compositor
Combined button and popup list for selecting options.
static QOpenGLCompositor * compositor
GLuint64 GLenum void * handle
GLdouble GLdouble GLdouble GLdouble q
unsigned long long quint64
QT_BEGIN_NAMESPACE typedef uchar * output
myObject disconnect()
[26]