From 7963e85b771852f96a923839cd0530219676914e Mon Sep 17 00:00:00 2001 From: Mikko Levonmaa Date: Tue, 10 Nov 2015 14:46:26 +0200 Subject: Make swap buffer call non-blocking for subsurfaces Allows clients that use subsurfaces in synchronized mode to continue processing the event loop even in cases where a frame callback is not delivered from the compositor pending a parent surface commit Change-Id: I7df38afc4080546b60184dacecde321ba8062fac Reviewed-by: Giulio Camuffo --- src/client/qwaylandsubsurface.cpp | 2 ++ src/client/qwaylandsubsurface_p.h | 3 +++ 2 files changed, 5 insertions(+) (limited to 'src/client') diff --git a/src/client/qwaylandsubsurface.cpp b/src/client/qwaylandsubsurface.cpp index 72b80c18f..eac847c75 100644 --- a/src/client/qwaylandsubsurface.cpp +++ b/src/client/qwaylandsubsurface.cpp @@ -58,11 +58,13 @@ QWaylandSubSurface::~QWaylandSubSurface() void QWaylandSubSurface::setSync() { + QMutexLocker l(&m_syncLock); QWaylandSubSurface::set_sync(); } void QWaylandSubSurface::setDeSync() { + QMutexLocker l(&m_syncLock); QWaylandSubSurface::set_desync(); } diff --git a/src/client/qwaylandsubsurface_p.h b/src/client/qwaylandsubsurface_p.h index 5255df5c9..b8ea6aaf3 100644 --- a/src/client/qwaylandsubsurface_p.h +++ b/src/client/qwaylandsubsurface_p.h @@ -48,6 +48,7 @@ #include #include +#include #include #include @@ -71,6 +72,7 @@ public: void setSync(); void setDeSync(); bool isSync() const { return m_synchronized; } + QMutex *syncMutex() { return &m_syncLock; } private: @@ -81,6 +83,7 @@ private: QWaylandWindow *m_window; QWaylandWindow *m_parent; bool m_synchronized; + QMutex m_syncLock; }; -- cgit v1.2.3