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/extensions/qwaylandivisurface.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/extensions/qwaylandivisurface.cpp')
-rw-r--r-- | src/compositor/extensions/qwaylandivisurface.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/compositor/extensions/qwaylandivisurface.cpp b/src/compositor/extensions/qwaylandivisurface.cpp index f6b87fb99..f0beef738 100644 --- a/src/compositor/extensions/qwaylandivisurface.cpp +++ b/src/compositor/extensions/qwaylandivisurface.cpp @@ -46,6 +46,8 @@ #include <QtWaylandCompositor/QWaylandResource> +#include <QtWaylandCompositor/private/qwaylandutils_p.h> + QT_BEGIN_NAMESPACE QWaylandSurfaceRole QWaylandIviSurfacePrivate::s_role("ivi_surface"); @@ -181,10 +183,9 @@ QWaylandSurfaceRole *QWaylandIviSurface::role() */ QWaylandIviSurface *QWaylandIviSurface::fromResource(wl_resource *resource) { - auto iviSurfaceResource = QWaylandIviSurfacePrivate::Resource::fromResource(resource); - if (!iviSurfaceResource) - return nullptr; - return static_cast<QWaylandIviSurfacePrivate *>(iviSurfaceResource->ivi_surface_object)->q_func(); + if (auto p = QtWayland::fromResource<QWaylandIviSurfacePrivate *>(resource)) + return p->q_func(); + return nullptr; } /*! |