summaryrefslogtreecommitdiffstats
path: root/examples/qml-compositor/main.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'examples/qml-compositor/main.cpp')
-rw-r--r--examples/qml-compositor/main.cpp13
1 files changed, 10 insertions, 3 deletions
diff --git a/examples/qml-compositor/main.cpp b/examples/qml-compositor/main.cpp
index 88bab787a..93b23c0e3 100644
--- a/examples/qml-compositor/main.cpp
+++ b/examples/qml-compositor/main.cpp
@@ -67,7 +67,8 @@ public:
setColor(Qt::black);
winId();
- connect(this, SIGNAL(frameSwapped()), this, SLOT(frameSwappedSlot()));
+ connect(this, SIGNAL(beforeSynchronizing()), this, SLOT(startFrame()), Qt::DirectConnection);
+ connect(this, SIGNAL(afterRendering()), this, SLOT(sendCallbacks()));
}
QWaylandSurface *fullscreenSurface() const
@@ -130,8 +131,14 @@ private slots:
emit windowDestroyed(QVariant::fromValue(item));
}
- void frameSwappedSlot() {
- frameFinished(m_fullscreenSurface);
+ void sendCallbacks() {
+ if (m_fullscreenSurface)
+ sendFrameCallbacks(QList<QWaylandSurface *>() << m_fullscreenSurface);
+ else
+ sendFrameCallbacks(surfaces());
+ }
+ void startFrame() {
+ frameStarted();
}
protected: