From 68e5d64a830909b722a9277e50cd61c4fc2f83e2 Mon Sep 17 00:00:00 2001 From: Giulio Camuffo Date: Wed, 13 Aug 2014 13:20:44 +0300 Subject: [PATCH] Reset the wl_keyboard/wl_pointer resource pointers if destroyed Change-Id: I8693f845817d2dd4b0e0b54352c374f6a0e643d3 Reviewed-by: Robin Burchell --- tests/auto/wayland/mockinput.cpp | 13 +++++++++++++ tests/auto/wayland/mockinput.h | 6 ++++++ 2 files changed, 19 insertions(+) diff --git a/tests/auto/wayland/mockinput.cpp b/tests/auto/wayland/mockinput.cpp index 40b01317f9a..7dbb735ed22 100644 --- a/tests/auto/wayland/mockinput.cpp +++ b/tests/auto/wayland/mockinput.cpp @@ -164,6 +164,13 @@ void Keyboard::sendKey(uint32_t key, uint32_t state) } } + +void Keyboard::keyboard_destroy_resource(wl_keyboard::Resource *resource) +{ + if (m_focusResource == resource) + m_focusResource = 0; +} + Pointer::Pointer(Compositor *compositor) : wl_pointer() , m_compositor(compositor) @@ -210,4 +217,10 @@ void Pointer::sendButton(uint32_t button, uint32_t state) } } +void Pointer::pointer_destroy_resource(wl_pointer::Resource *resource) +{ + if (m_focusResource == resource) + m_focusResource = 0; +} + } diff --git a/tests/auto/wayland/mockinput.h b/tests/auto/wayland/mockinput.h index 669bfaed608..128758cad93 100644 --- a/tests/auto/wayland/mockinput.h +++ b/tests/auto/wayland/mockinput.h @@ -88,6 +88,9 @@ public: void sendKey(uint32_t key, uint32_t state); +protected: + void keyboard_destroy_resource(wl_keyboard::Resource *resource) Q_DECL_OVERRIDE; + private: Compositor *m_compositor; @@ -107,6 +110,9 @@ public: void sendMotion(const QPoint &pos); void sendButton(uint32_t button, uint32_t state); +protected: + void pointer_destroy_resource(wl_pointer::Resource *resource) Q_DECL_OVERRIDE; + private: Compositor *m_compositor;