From 6029a684334d4c2889bfd3ed33a855f0167fdcf7 Mon Sep 17 00:00:00 2001 From: Vlad Zahorodnii Date: Fri, 22 Sep 2023 14:29:17 +0300 Subject: [PATCH] backends/fakeinput: Implement fake-input v5 --- autotests/integration/kwin_wayland_test.h | 2 ++ autotests/integration/test_helpers.cpp | 5 +++++ src/backends/fakeinput/fakeinputbackend.cpp | 8 +++++++- 3 files changed, 14 insertions(+), 1 deletion(-) diff --git a/autotests/integration/kwin_wayland_test.h b/autotests/integration/kwin_wayland_test.h index 735ec3ee44..67ff050c6b 100644 --- a/autotests/integration/kwin_wayland_test.h +++ b/autotests/integration/kwin_wayland_test.h @@ -524,6 +524,8 @@ public: class FakeInput : public QtWayland::org_kde_kwin_fake_input { +public: + ~FakeInput() override; }; enum class AdditionalWaylandInterface { diff --git a/autotests/integration/test_helpers.cpp b/autotests/integration/test_helpers.cpp index 4e0137a68b..d51af634c6 100644 --- a/autotests/integration/test_helpers.cpp +++ b/autotests/integration/test_helpers.cpp @@ -260,6 +260,11 @@ CursorShapeDeviceV1::~CursorShapeDeviceV1() destroy(); } +FakeInput::~FakeInput() +{ + destroy(); +} + static struct { KWayland::Client::ConnectionThread *connection = nullptr; diff --git a/src/backends/fakeinput/fakeinputbackend.cpp b/src/backends/fakeinput/fakeinputbackend.cpp index 13db028d73..2c4cdb6583 100644 --- a/src/backends/fakeinput/fakeinputbackend.cpp +++ b/src/backends/fakeinput/fakeinputbackend.cpp @@ -13,7 +13,7 @@ namespace KWin { -static const quint32 s_version = 4; +static const quint32 s_version = 5; class FakeInputBackendPrivate : public QtWaylandServer::org_kde_kwin_fake_input { @@ -42,6 +42,7 @@ protected: void org_kde_kwin_fake_input_touch_frame(Resource *resource) override; void org_kde_kwin_fake_input_pointer_motion_absolute(Resource *resource, wl_fixed_t x, wl_fixed_t y) override; void org_kde_kwin_fake_input_keyboard_key(Resource *resource, uint32_t button, uint32_t state) override; + void org_kde_kwin_fake_input_destroy(Resource *resource) override; }; QList FakeInputBackendPrivate::touchIds = QList(); @@ -59,6 +60,11 @@ void FakeInputBackendPrivate::org_kde_kwin_fake_input_bind_resource(Resource *re Q_EMIT q->deviceAdded(device); } +void FakeInputBackendPrivate::org_kde_kwin_fake_input_destroy(Resource *resource) +{ + wl_resource_destroy(resource->handle); +} + void FakeInputBackendPrivate::org_kde_kwin_fake_input_destroy_resource(Resource *resource) { auto it = devices.find(resource);