diff options
author | Johan Klokkhammer Helsing <johan.helsing@qt.io> | 2018-11-16 12:26:14 +0100 |
---|---|---|
committer | Johan Helsing <johan.helsing@qt.io> | 2018-11-21 12:18:12 +0000 |
commit | 792057b7124bfc9a9aa0b1110693d6f868a1de58 (patch) | |
tree | 37427524721f757a0ab202f6bd5c1e2a80c55438 /src/compositor/compositor_api/qwaylandsurface.cpp | |
parent | 6b077d6cdb6f1131de47574c617360f44a0625e7 (diff) |
Add convenience for converting wl_resource * to wrapper types
Change-Id: Ieb2f9706ac707ff878165d3f9001e4a28b8ff1ce
Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
Diffstat (limited to 'src/compositor/compositor_api/qwaylandsurface.cpp')
-rw-r--r-- | src/compositor/compositor_api/qwaylandsurface.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/compositor/compositor_api/qwaylandsurface.cpp b/src/compositor/compositor_api/qwaylandsurface.cpp index 59e741c84..be08b17c7 100644 --- a/src/compositor/compositor_api/qwaylandsurface.cpp +++ b/src/compositor/compositor_api/qwaylandsurface.cpp @@ -59,6 +59,7 @@ #include <QtWaylandCompositor/private/qwaylandcompositor_p.h> #include <QtWaylandCompositor/private/qwaylandview_p.h> #include <QtWaylandCompositor/private/qwaylandseat_p.h> +#include <QtWaylandCompositor/private/qwaylandutils_p.h> #include <QtCore/private/qobject_p.h> @@ -793,10 +794,10 @@ QList<QWaylandView *> QWaylandSurface::views() const /*! * Returns the QWaylandSurface corresponding to the Wayland resource \a res. */ -QWaylandSurface *QWaylandSurface::fromResource(::wl_resource *res) +QWaylandSurface *QWaylandSurface::fromResource(::wl_resource *resource) { - if (auto *r = QWaylandSurfacePrivate::Resource::fromResource(res)) - return static_cast<QWaylandSurfacePrivate *>(r->surface_object)->q_func(); + if (auto p = QtWayland::fromResource<QWaylandSurfacePrivate *>(resource)) + return p->q_func(); return nullptr; } |