summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJungi Byun <jungi.byun@lge.com>2022-03-24 12:09:39 +0900
committerElvis Lee <kwangwoong.lee@lge.com>2022-03-31 07:44:20 +0000
commit156674e10278ac218bdb766be90109b74e584760 (patch)
treee0ddbec34b0b3e8a9b731b1718a65f4131b5ab80
parentd607f2ac5760044aba3c9ee5e77f76ebe8420a86 (diff)
Fix to have presentation feedback sequence timely
In the case connections in PresentationFeedback are QueuedConnection, there are sometimes a signal to be connected is emitted before creating another connection on the signal from the connection's slot method, and this makes wrong feedbacks. In order to send proper feedbacks to clients, create related connection earlier and make to work properly by checking some conditions. Pick-to: 6.3 Change-Id: Ic8f02139ca08713c419b0341b9a1e8add6f5a095 Reviewed-by: Elvis Lee <kwangwoong.lee@lge.com> Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
-rw-r--r--src/compositor/extensions/qwaylandpresentationtime.cpp9
-rw-r--r--src/compositor/extensions/qwaylandpresentationtime_p_p.h1
2 files changed, 7 insertions, 3 deletions
diff --git a/src/compositor/extensions/qwaylandpresentationtime.cpp b/src/compositor/extensions/qwaylandpresentationtime.cpp
index 81bed5e87..b17fb5978 100644
--- a/src/compositor/extensions/qwaylandpresentationtime.cpp
+++ b/src/compositor/extensions/qwaylandpresentationtime.cpp
@@ -266,6 +266,7 @@ void PresentationFeedback::connectToWindow(QQuickWindow *window)
m_connectedWindow = window;
connect(window, &QQuickWindow::beforeSynchronizing, this, &PresentationFeedback::onSync);
+ connect(window, &QQuickWindow::afterFrameEnd, this, &PresentationFeedback::onSwapped);
}
void PresentationFeedback::onSync()
@@ -275,7 +276,7 @@ void PresentationFeedback::onSync()
if (m_committed) {
disconnect(m_surface, &QWaylandSurface::damaged, this, &PresentationFeedback::onSurfaceCommit);
disconnect(window, &QQuickWindow::beforeSynchronizing, this, &PresentationFeedback::onSync);
- connect(window, &QQuickWindow::afterFrameEnd, this, &PresentationFeedback::onSwapped);
+ m_sync = true;
}
}
@@ -283,8 +284,10 @@ void PresentationFeedback::onSwapped()
{
QQuickWindow *window = qobject_cast<QQuickWindow *>(sender());
- disconnect(window, &QQuickWindow::afterFrameEnd, this, &PresentationFeedback::onSwapped);
- connect(m_presentationTime, &QWaylandPresentationTime::presented, this, &PresentationFeedback::sendPresented);
+ if (m_sync) {
+ disconnect(window, &QQuickWindow::afterFrameEnd, this, &PresentationFeedback::onSwapped);
+ connect(m_presentationTime, &QWaylandPresentationTime::presented, this, &PresentationFeedback::sendPresented);
+ }
}
void PresentationFeedback::discard()
diff --git a/src/compositor/extensions/qwaylandpresentationtime_p_p.h b/src/compositor/extensions/qwaylandpresentationtime_p_p.h
index 7f984958b..fc56a048b 100644
--- a/src/compositor/extensions/qwaylandpresentationtime_p_p.h
+++ b/src/compositor/extensions/qwaylandpresentationtime_p_p.h
@@ -89,6 +89,7 @@ public:
QQuickWindow *m_connectedWindow = nullptr;
bool m_committed = false;
+ bool m_sync = false;
};
class QWaylandPresentationTimePrivate : public QWaylandCompositorExtensionPrivate, public QtWaylandServer::wp_presentation