From 2132dddf0d47e12e2dc28a6fbb0181a36713e7d8 Mon Sep 17 00:00:00 2001 From: Xaver Hugl Date: Wed, 21 Jun 2023 16:20:50 +0200 Subject: [PATCH] layershellv1window: don't destroy the window twice Outputs get disabled before they get destroyed, so destroying the window when the output gets disabled and when it gets destroyed causes the window to be destroyed twice and run into an assert --- src/layershellv1window.cpp | 9 +-------- src/layershellv1window.h | 1 - 2 files changed, 1 insertion(+), 9 deletions(-) diff --git a/src/layershellv1window.cpp b/src/layershellv1window.cpp index f01e2ac385..d8fe017f30 100644 --- a/src/layershellv1window.cpp +++ b/src/layershellv1window.cpp @@ -58,8 +58,6 @@ LayerShellV1Window::LayerShellV1Window(LayerSurfaceV1Interface *shellSurface, this, &LayerShellV1Window::scheduleRearrange); connect(output, &Output::enabledChanged, this, &LayerShellV1Window::handleOutputEnabledChanged); - connect(output, &Output::destroyed, - this, &LayerShellV1Window::handleOutputDestroyed); connect(shellSurface->surface(), &SurfaceInterface::sizeChanged, this, &LayerShellV1Window::handleSizeChanged); @@ -180,6 +178,7 @@ void LayerShellV1Window::destroyWindow() } m_shellSurface->disconnect(this); m_shellSurface->surface()->disconnect(this); + m_desiredOutput->disconnect(this); markAsDeleted(); cleanTabBox(); @@ -279,12 +278,6 @@ void LayerShellV1Window::handleOutputEnabledChanged() } } -void LayerShellV1Window::handleOutputDestroyed() -{ - closeWindow(); - destroyWindow(); -} - void LayerShellV1Window::setVirtualKeyboardGeometry(const QRectF &geo) { if (m_virtualKeyboardGeometry == geo) { diff --git a/src/layershellv1window.h b/src/layershellv1window.h index fa82e61eea..f2c5aa2da2 100644 --- a/src/layershellv1window.h +++ b/src/layershellv1window.h @@ -60,7 +60,6 @@ private: void handleCommitted(); void handleAcceptsFocusChanged(); void handleOutputEnabledChanged(); - void handleOutputDestroyed(); void scheduleRearrange(); void activateScreenEdge(); void deactivateScreenEdge();