summaryrefslogtreecommitdiffstats
path: root/tests/auto/client/shared/mockwlshell.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto/client/shared/mockwlshell.cpp')
-rw-r--r--tests/auto/client/shared/mockwlshell.cpp14
1 files changed, 7 insertions, 7 deletions
diff --git a/tests/auto/client/shared/mockwlshell.cpp b/tests/auto/client/shared/mockwlshell.cpp
index b7700713f..50e539932 100644
--- a/tests/auto/client/shared/mockwlshell.cpp
+++ b/tests/auto/client/shared/mockwlshell.cpp
@@ -31,19 +31,19 @@
namespace Impl {
-class WlShellSurface : public QtWaylandServer::wl_shell_surface
-{
-public:
- explicit WlShellSurface(::wl_client *client, int id, Surface *surface);
- void shell_surface_destroy_resource(Resource *) override { delete this; }
-};
-
WlShellSurface::WlShellSurface(wl_client *client, int id, Surface *surface)
: QtWaylandServer::wl_shell_surface(client, id, 1)
+ , m_surface(surface)
{
+ surface->m_wlShellSurface = this;
surface->map();
}
+WlShellSurface::~WlShellSurface()
+{
+ m_surface->m_wlShellSurface = nullptr;
+}
+
void WlShell::shell_get_shell_surface(QtWaylandServer::wl_shell::Resource *resource, uint32_t id, wl_resource *surface)
{
new WlShellSurface(resource->client(), id, Surface::fromResource(surface));