summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorGiulio Camuffo <giulio.camuffo@jollamobile.com>2014-08-13 13:20:44 +0300
committerGiulio Camuffo <giulio.camuffo@jollamobile.com>2014-08-13 13:20:36 +0200
commit6842ece98dc4b496fca075b6f864d8f78c1057d0 (patch)
treec5c95fb1726fdcb50a121ff1a40eb77218b79979 /tests
parentb5dd5ae323569d6417a6e5d841fa3386bbdd4841 (diff)
Reset the wl_keyboard/wl_pointer resource pointers if destroyed
Change-Id: I8693f845817d2dd4b0e0b54352c374f6a0e643d3 Reviewed-by: Robin Burchell <robin.burchell@viroteck.net>
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/client/mockinput.cpp13
-rw-r--r--tests/auto/client/mockinput.h6
2 files changed, 19 insertions, 0 deletions
diff --git a/tests/auto/client/mockinput.cpp b/tests/auto/client/mockinput.cpp
index 40b01317f..7dbb735ed 100644
--- a/tests/auto/client/mockinput.cpp
+++ b/tests/auto/client/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/client/mockinput.h b/tests/auto/client/mockinput.h
index 669bfaed6..128758cad 100644
--- a/tests/auto/client/mockinput.h
+++ b/tests/auto/client/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;