diff --git a/plugins/mousepad/waylandremoteinput.cpp b/plugins/mousepad/waylandremoteinput.cpp index 6b101deb8..443d98509 100644 --- a/plugins/mousepad/waylandremoteinput.cpp +++ b/plugins/mousepad/waylandremoteinput.cpp @@ -46,6 +46,7 @@ WaylandRemoteInput::WaylandRemoteInput(QObject* parent) m_waylandInput = registry->createFakeInput(name, version, this); } ); + connect(registry, &Registry::fakeInputRemoved, m_waylandInput, &QObject::deleteLater); registry->setup(); } diff --git a/plugins/mousepad/waylandremoteinput.h b/plugins/mousepad/waylandremoteinput.h index 31b6b1f2f..6f9685ba9 100644 --- a/plugins/mousepad/waylandremoteinput.h +++ b/plugins/mousepad/waylandremoteinput.h @@ -21,6 +21,7 @@ #ifndef WAYLANDREMOTEINPUT_H #define WAYLANDREMOTEINPUT_H +#include #include "abstractremoteinput.h" namespace KWayland @@ -44,7 +45,7 @@ public: private: void setupWaylandIntegration(); - KWayland::Client::FakeInput* m_waylandInput; + QPointer m_waylandInput; bool m_waylandAuthenticationRequested; };