Client: Fix up thread usage for mSurface
It didn't make sense that mSurface was protected, but the mutex was not. Also try to improve documentation. Change-Id: I2f59557cccbb2d6f0b2772ce3c8a2dab01167a6c Reviewed-by: David Edmundson <davidedmundson@kde.org>
This commit is contained in:
parent
b72632e01e
commit
fe472ee0f4
@ -76,8 +76,8 @@ QWaylandWindow *QWaylandWindow::mMouseGrab = nullptr;
|
|||||||
QWaylandWindow::QWaylandWindow(QWindow *window, QWaylandDisplay *display)
|
QWaylandWindow::QWaylandWindow(QWindow *window, QWaylandDisplay *display)
|
||||||
: QPlatformWindow(window)
|
: QPlatformWindow(window)
|
||||||
, mDisplay(display)
|
, mDisplay(display)
|
||||||
, mResizeAfterSwap(qEnvironmentVariableIsSet("QT_WAYLAND_RESIZE_AFTER_SWAP"))
|
|
||||||
, mSurfaceLock(QReadWriteLock::Recursive)
|
, mSurfaceLock(QReadWriteLock::Recursive)
|
||||||
|
, mResizeAfterSwap(qEnvironmentVariableIsSet("QT_WAYLAND_RESIZE_AFTER_SWAP"))
|
||||||
{
|
{
|
||||||
{
|
{
|
||||||
bool ok;
|
bool ok;
|
||||||
|
@ -253,7 +253,11 @@ protected:
|
|||||||
QMargins clientSideMargins() const;
|
QMargins clientSideMargins() const;
|
||||||
|
|
||||||
QWaylandDisplay *mDisplay = nullptr;
|
QWaylandDisplay *mDisplay = nullptr;
|
||||||
|
|
||||||
|
// mSurface can be written by the main thread. Other threads should claim a read lock for access
|
||||||
|
mutable QReadWriteLock mSurfaceLock;
|
||||||
QScopedPointer<QWaylandSurface> mSurface;
|
QScopedPointer<QWaylandSurface> mSurface;
|
||||||
|
|
||||||
QWaylandShellSurface *mShellSurface = nullptr;
|
QWaylandShellSurface *mShellSurface = nullptr;
|
||||||
QWaylandSubSurface *mSubSurfaceWindow = nullptr;
|
QWaylandSubSurface *mSubSurfaceWindow = nullptr;
|
||||||
QList<QWaylandSubSurface *> mChildren;
|
QList<QWaylandSubSurface *> mChildren;
|
||||||
@ -343,8 +347,6 @@ private:
|
|||||||
|
|
||||||
static QWaylandWindow *mMouseGrab;
|
static QWaylandWindow *mMouseGrab;
|
||||||
|
|
||||||
mutable QReadWriteLock mSurfaceLock;
|
|
||||||
|
|
||||||
friend class QWaylandSubSurface;
|
friend class QWaylandSubSurface;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user