summaryrefslogtreecommitdiffstats
path: root/tests/auto/compositor/compositor/mockclient.h
diff options
context:
space:
mode:
authorJohan Klokkhammer Helsing <johan.helsing@qt.io>2017-08-28 12:58:55 +0200
committerJohan Helsing <johan.helsing@qt.io>2017-10-25 11:37:38 +0000
commit063299d8520ca5c944a596723e63e7654e712955 (patch)
treec8d609fee9fbdfb83f3792082214322a646997ca /tests/auto/compositor/compositor/mockclient.h
parenta89d294a2e15995a707316608e6df0efc31b1857 (diff)
qtwaylandscanner: Remove globals when destroying wrappers
When globals are destroyed on the compositor side, send the "global_remove" event and set the resource implementation to nullptr so all further requests are ignored. This also adds a compositor test to see if outputs are removed when they are deleted. Change-Id: Ib77a4c3d4c2c93283a14ac20f5964e2ce08a1d38 Reviewed-by: David Edmundson <davidedmundson@kde.org> Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
Diffstat (limited to 'tests/auto/compositor/compositor/mockclient.h')
-rw-r--r--tests/auto/compositor/compositor/mockclient.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/tests/auto/compositor/compositor/mockclient.h b/tests/auto/compositor/compositor/mockclient.h
index 1881393a6..7aa6a3b7b 100644
--- a/tests/auto/compositor/compositor/mockclient.h
+++ b/tests/auto/compositor/compositor/mockclient.h
@@ -64,7 +64,7 @@ public:
wl_display *display;
wl_compositor *compositor;
- wl_output *output;
+ QVector<wl_output *> m_outputs;
wl_shm *shm;
wl_registry *registry;
wl_shell *wlshell;
@@ -96,6 +96,7 @@ private:
static MockClient *resolve(void *data) { return static_cast<MockClient *>(data); }
static const struct wl_registry_listener registryListener;
static void handleGlobal(void *data, struct wl_registry *registry, uint32_t id, const char *interface, uint32_t version);
+ static void handleGlobalRemove(void *data, struct wl_registry *wl_registry, uint32_t id);
static int sourceUpdate(uint32_t mask, void *data);
static void outputGeometryEvent(void *data,
@@ -117,6 +118,7 @@ private:
static void outputScale(void *data, wl_output *output, int factor);
void handleGlobal(uint32_t id, const QByteArray &interface);
+ void handleGlobalRemove(uint32_t id);
static const wl_output_listener outputListener;
};