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.
This commit is contained in:
Vlad Zahorodnii 2023-03-23 10:29:24 +02:00
parent bffeae89c7
commit 82ef63a3d4
3 changed files with 3 additions and 1 deletions

View file

@ -39,7 +39,7 @@ InputPanelV1Window::InputPanelV1Window(InputPanelSurfaceV1Interface *panelSurfac
connect(panelSurface, &InputPanelSurfaceV1Interface::topLevel, this, &InputPanelV1Window::showTopLevel); connect(panelSurface, &InputPanelSurfaceV1Interface::topLevel, this, &InputPanelV1Window::showTopLevel);
connect(panelSurface, &InputPanelSurfaceV1Interface::overlayPanel, this, &InputPanelV1Window::showOverlayPanel); 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); connect(workspace(), &Workspace::outputsChanged, this, &InputPanelV1Window::reposition);

View file

@ -347,6 +347,7 @@ InputPanelSurfaceV1Interface::InputPanelSurfaceV1Interface(SurfaceInterface *sur
InputPanelSurfaceV1Interface::~InputPanelSurfaceV1Interface() InputPanelSurfaceV1Interface::~InputPanelSurfaceV1Interface()
{ {
Q_EMIT aboutToBeDestroyed();
} }
class InputPanelV1InterfacePrivate : public QtWaylandServer::zwp_input_panel_v1 class InputPanelV1InterfacePrivate : public QtWaylandServer::zwp_input_panel_v1

View file

@ -139,6 +139,7 @@ public:
Q_SIGNALS: Q_SIGNALS:
void topLevel(OutputInterface *output, Position position); void topLevel(OutputInterface *output, Position position);
void overlayPanel(); void overlayPanel();
void aboutToBeDestroyed();
private: private:
InputPanelSurfaceV1Interface(SurfaceInterface *surface, quint32 id, QObject *parent); InputPanelSurfaceV1Interface(SurfaceInterface *surface, quint32 id, QObject *parent);