From 519ca669b08f0bce45d645d271bd1236bdb3970a Mon Sep 17 00:00:00 2001 From: Aleix Pol Date: Tue, 13 Oct 2020 01:31:54 +0200 Subject: Implement CoreProtocol::compositor_create_region Otherwise tests using it crash. Pick-to: 5.15 Change-Id: Id2ce98ed7c975144728be7566e20b6ea08fa9150 Reviewed-by: David Edmundson --- tests/auto/client/shared/coreprotocol.h | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/tests/auto/client/shared/coreprotocol.h b/tests/auto/client/shared/coreprotocol.h index 3670dc641..45f93ec55 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 -- cgit v1.2.3