diff options
author | Giulio Camuffo <giulio.camuffo@jollamobile.com> | 2014-02-06 15:58:39 +0200 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2014-02-09 15:20:11 +0100 |
commit | c7c788de03b2285a1e3f278dcbcf86368cedeec2 (patch) | |
tree | 6eb793003bc6882360402375bcf5f1a86ef08072 /src/compositor/wayland_wrapper/qwlsurface.cpp | |
parent | 73fa84a4408126e05a1f0706f0e5aa92d0d6de69 (diff) |
Fix build with Wayland <= 1.1
Change-Id: Idd12c0db73203daa008d93c0dc8053e25dff09e2
Reviewed-by: Jørgen Lind <jorgen.lind@digia.com>
Diffstat (limited to 'src/compositor/wayland_wrapper/qwlsurface.cpp')
-rw-r--r-- | src/compositor/wayland_wrapper/qwlsurface.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/compositor/wayland_wrapper/qwlsurface.cpp b/src/compositor/wayland_wrapper/qwlsurface.cpp index b7f45c675..1d01667b3 100644 --- a/src/compositor/wayland_wrapper/qwlsurface.cpp +++ b/src/compositor/wayland_wrapper/qwlsurface.cpp @@ -79,7 +79,12 @@ public: : surface(surf) , resource(res) { +#if WAYLAND_VERSION_MAJOR < 1 || (WAYLAND_VERSION_MAJOR == 1 && WAYLAND_VERSION_MINOR <= 2) + res->data = this; + res->destroy = destroyCallback; +#else wl_resource_set_implementation(res, 0, this, destroyCallback); +#endif } ~FrameCallback() { @@ -98,7 +103,11 @@ public: } static void destroyCallback(wl_resource *res) { +#if WAYLAND_VERSION_MAJOR < 1 || (WAYLAND_VERSION_MAJOR == 1 && WAYLAND_VERSION_MINOR <= 2) + FrameCallback *_this = static_cast<FrameCallback *>(res->data); +#else FrameCallback *_this = static_cast<FrameCallback *>(wl_resource_get_user_data(res)); +#endif _this->surface->removeFrameCallback(_this); delete _this; } |