From 82ef63a3d4a77df20acc45cf469757485bb4d515 Mon Sep 17 00:00:00 2001 From: Vlad Zahorodnii Date: Thu, 23 Mar 2023 10:29:24 +0200 Subject: [PATCH] wayland: Use correct signal to get notified when to destroy InputPanelV1Window The window should be destroyed when the associated surface role is about to be destroyed. QObject::destroyed is too late. --- src/inputpanelv1window.cpp | 2 +- src/wayland/inputmethod_v1_interface.cpp | 1 + src/wayland/inputmethod_v1_interface.h | 1 + 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/inputpanelv1window.cpp b/src/inputpanelv1window.cpp index 0547a847c5..72fb1b7825 100644 --- a/src/inputpanelv1window.cpp +++ b/src/inputpanelv1window.cpp @@ -39,7 +39,7 @@ InputPanelV1Window::InputPanelV1Window(InputPanelSurfaceV1Interface *panelSurfac connect(panelSurface, &InputPanelSurfaceV1Interface::topLevel, this, &InputPanelV1Window::showTopLevel); connect(panelSurface, &InputPanelSurfaceV1Interface::overlayPanel, this, &InputPanelV1Window::showOverlayPanel); - connect(panelSurface, &InputPanelSurfaceV1Interface::destroyed, this, &InputPanelV1Window::destroyWindow); + connect(panelSurface, &InputPanelSurfaceV1Interface::aboutToBeDestroyed, this, &InputPanelV1Window::destroyWindow); connect(workspace(), &Workspace::outputsChanged, this, &InputPanelV1Window::reposition); diff --git a/src/wayland/inputmethod_v1_interface.cpp b/src/wayland/inputmethod_v1_interface.cpp index 413ce0d239..ff023dacc2 100644 --- a/src/wayland/inputmethod_v1_interface.cpp +++ b/src/wayland/inputmethod_v1_interface.cpp @@ -347,6 +347,7 @@ InputPanelSurfaceV1Interface::InputPanelSurfaceV1Interface(SurfaceInterface *sur InputPanelSurfaceV1Interface::~InputPanelSurfaceV1Interface() { + Q_EMIT aboutToBeDestroyed(); } class InputPanelV1InterfacePrivate : public QtWaylandServer::zwp_input_panel_v1 diff --git a/src/wayland/inputmethod_v1_interface.h b/src/wayland/inputmethod_v1_interface.h index 56044f879c..e12a3d2828 100644 --- a/src/wayland/inputmethod_v1_interface.h +++ b/src/wayland/inputmethod_v1_interface.h @@ -139,6 +139,7 @@ public: Q_SIGNALS: void topLevel(OutputInterface *output, Position position); void overlayPanel(); + void aboutToBeDestroyed(); private: InputPanelSurfaceV1Interface(SurfaceInterface *surface, quint32 id, QObject *parent);