From fa538edc74c377ef79d8c50ae8bb0a213e36cc11 Mon Sep 17 00:00:00 2001 From: Xaver Hugl Date: Fri, 16 Sep 2022 17:20:08 +0200 Subject: [PATCH] waylandserver: don't emit windowRemoved if it's not been added yet This can happen when a client destroys the window before it ever got ready for painting --- src/wayland_server.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/wayland_server.cpp b/src/wayland_server.cpp index 2f20905a23..4317c13176 100644 --- a/src/wayland_server.cpp +++ b/src/wayland_server.cpp @@ -687,7 +687,9 @@ void WaylandServer::destroyInputMethodConnection() void WaylandServer::removeWindow(Window *c) { m_windows.removeAll(c); - Q_EMIT windowRemoved(c); + if (c->readyForPainting()) { + Q_EMIT windowRemoved(c); + } } static Window *findWindowInList(const QList &windows, const KWaylandServer::SurfaceInterface *surface)