summaryrefslogtreecommitdiffstats
path: root/tests/auto/client/client/mockinput.cpp
diff options
context:
space:
mode:
authorJohan Klokkhammer Helsing <johan.helsing@qt.io>2016-10-10 18:01:43 +0200
committerJohan Helsing <johan.helsing@qt.io>2016-10-11 09:43:26 +0000
commite3cc20df4290ef0364206e930ed43ae06bd6ed58 (patch)
tree7321649c8bbe8f1bf2b3b53eeb89611de46a717d /tests/auto/client/client/mockinput.cpp
parentacb37c995a93b208540d73dc9035d924db3d646d (diff)
Clients tests: Don't send leave events for destroyed surfaces
Change-Id: Ia7dd13f629439b116f494ff8b7432020a65ea1df Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
Diffstat (limited to 'tests/auto/client/client/mockinput.cpp')
-rw-r--r--tests/auto/client/client/mockinput.cpp16
1 files changed, 16 insertions, 0 deletions
diff --git a/tests/auto/client/client/mockinput.cpp b/tests/auto/client/client/mockinput.cpp
index fe06bf79b..99acdd43a 100644
--- a/tests/auto/client/client/mockinput.cpp
+++ b/tests/auto/client/client/mockinput.cpp
@@ -267,6 +267,14 @@ void Keyboard::setFocus(Surface *surface)
m_focus = surface;
}
+void Keyboard::handleSurfaceDestroyed(Surface *surface)
+{
+ if (surface == m_focus) {
+ m_focusResource = nullptr;
+ m_focus = nullptr;
+ }
+}
+
void Keyboard::sendKey(uint32_t key, uint32_t state)
{
if (m_focusResource) {
@@ -314,6 +322,14 @@ void Pointer::setFocus(Surface *surface, const QPoint &pos)
m_focus = surface;
}
+void Pointer::handleSurfaceDestroyed(Surface *surface)
+{
+ if (m_focus == surface) {
+ m_focus = nullptr;
+ m_focusResource = nullptr;
+ }
+}
+
void Pointer::sendMotion(const QPoint &pos)
{
if (m_focusResource)