diff options
author | Aleix Pol <aleixpol@kde.org> | 2020-10-13 01:31:54 +0200 |
---|---|---|
committer | Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> | 2020-10-15 14:50:33 +0000 |
commit | 707b23cf11586304912b3ea87099cf46a0aac912 (patch) | |
tree | 45b5c7d5732e71b85b6cc9c30126ea3532a0ab55 | |
parent | 45a3a3208a4243d9b0a6500e3dcd0fcfed2dfcea (diff) | |
download | qtwayland-707b23cf11586304912b3ea87099cf46a0aac912.tar.gz |
Implement CoreProtocol::compositor_create_region
Otherwise tests using it crash.
Change-Id: Id2ce98ed7c975144728be7566e20b6ea08fa9150
Reviewed-by: David Edmundson <davidedmundson@kde.org>
(cherry picked from commit 519ca669b08f0bce45d645d271bd1236bdb3970a)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
-rw-r--r-- | tests/auto/client/shared/coreprotocol.h | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/tests/auto/client/shared/coreprotocol.h b/tests/auto/client/shared/coreprotocol.h index 8d5e2d66..efd4c8b3 100644 --- a/tests/auto/client/shared/coreprotocol.h +++ b/tests/auto/client/shared/coreprotocol.h @@ -139,6 +139,21 @@ protected: void surface_frame(Resource *resource, uint32_t callback) override; }; +class Region : public QtWaylandServer::wl_region +{ +public: + explicit Region(wl_client *client, int id, int version) + : QtWaylandServer::wl_region(client, id, version) + { + } + + void region_destroy_resource(Resource *resource) override + { + Q_UNUSED(resource); + delete this; + } +}; + class WlCompositor : public Global, public QtWaylandServer::wl_compositor { Q_OBJECT @@ -162,6 +177,12 @@ protected: m_surfaces.append(surface); emit surfaceCreated(surface); } + + static void compositor_create_region(wl_client *client, wl_resource *compositorResource, + uint32_t id) + { + new Region(client, id, wl_resource_get_version(compositorResource)); + } }; class Subsurface : public QObject, public QtWaylandServer::wl_subsurface |