From 37719da680462712b975f6b734bdf8aa95df4adf Mon Sep 17 00:00:00 2001 From: Mikko Harju Date: Thu, 25 Jun 2015 15:38:28 +0300 Subject: Reset surface transientParent when the parent is destroyed. If a transient parent of a surface is destroyed before the surface itself, reset all references to that parent surface. Change-Id: I5b748099d8a5502632d8846c5de5381b5f28b665 Reviewed-by: Giulio Camuffo --- src/compositor/wayland_wrapper/qwlsurface.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/compositor/wayland_wrapper/qwlsurface.cpp b/src/compositor/wayland_wrapper/qwlsurface.cpp index 4cadbb59..2b7f21ae 100644 --- a/src/compositor/wayland_wrapper/qwlsurface.cpp +++ b/src/compositor/wayland_wrapper/qwlsurface.cpp @@ -408,6 +408,14 @@ void Surface::surface_destroy_resource(Resource *) m_extendedSurface = 0; } + if (transientParent()) { + foreach (Surface *surface, compositor()->surfaces()) { + if (surface->transientParent() == this) { + surface->setTransientParent(0); + } + } + } + m_destroyed = true; m_waylandSurface->destroy(); emit m_waylandSurface->surfaceDestroyed(); -- cgit v1.2.3