diff options
author | David Redondo <qt@david-redondo.de> | 2023-12-06 14:51:53 +0100 |
---|---|---|
committer | David Redondo <qt@david-redondo.de> | 2024-01-19 15:02:15 +0100 |
commit | d249c1f74324980ff4ba77eda79676354b143c3d (patch) | |
tree | a35fea0cd88a6cce53c5bcfbc103b420feb55173 | |
parent | 7b06ee44eab57000c597f9154c802ad06078c281 (diff) |
Mark QWaylandWindow::wlSurface as const
Change-Id: I416fee67bb35a88f55ac6d24d203e607f1ea1f32
Reviewed-by: David Edmundson <davidedmundson@kde.org>
-rw-r--r-- | src/client/qwaylandwindow.cpp | 2 | ||||
-rw-r--r-- | src/client/qwaylandwindow_p.h | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/src/client/qwaylandwindow.cpp b/src/client/qwaylandwindow.cpp index 75942a238..2be24111d 100644 --- a/src/client/qwaylandwindow.cpp +++ b/src/client/qwaylandwindow.cpp @@ -933,7 +933,7 @@ QPointF QWaylandWindow::mapFromWlSurface(const QPointF &surfacePosition) const return QPointF(surfacePosition.x() - margins.left(), surfacePosition.y() - margins.top()); } -wl_surface *QWaylandWindow::wlSurface() +wl_surface *QWaylandWindow::wlSurface() const { QReadLocker locker(&mSurfaceLock); return mSurface ? mSurface->object() : nullptr; diff --git a/src/client/qwaylandwindow_p.h b/src/client/qwaylandwindow_p.h index c2815cb8e..981a26cb9 100644 --- a/src/client/qwaylandwindow_p.h +++ b/src/client/qwaylandwindow_p.h @@ -129,10 +129,10 @@ public: QPointF mapFromWlSurface(const QPointF &surfacePosition) const; QWaylandSurface *waylandSurface() const { return mSurface.data(); } - ::wl_surface *wlSurface(); + ::wl_surface *wlSurface() const; ::wl_surface *surface() const override { - return const_cast<QWaylandWindow *>(this)->wlSurface(); + return wlSurface(); } static QWaylandWindow *fromWlSurface(::wl_surface *surface); |