Use proper signal to get notified when to reset virtual keyboard geometry

Currently, input method relies on the fact that QObject::destroyed and
Window::closed are equivalent. But it's going to change, so make the
input method use a signal that's semantically better.
This commit is contained in:
Vlad Zahorodnii 2023-03-22 15:59:34 +02:00
parent 2dca6cd003
commit c5f08d62d1

View file

@ -235,7 +235,7 @@ void InputMethod::setPanel(InputPanelV1Window *panel)
m_panel = panel; m_panel = panel;
connect(panel->surface(), &SurfaceInterface::inputChanged, this, &InputMethod::updateInputPanelState); connect(panel->surface(), &SurfaceInterface::inputChanged, this, &InputMethod::updateInputPanelState);
connect(panel, &QObject::destroyed, this, [this] { connect(panel, &Window::closed, this, [this]() {
if (m_trackedWindow) { if (m_trackedWindow) {
m_trackedWindow->setVirtualKeyboardGeometry({}); m_trackedWindow->setVirtualKeyboardGeometry({});
} }