diff --git a/src/inputmethod.cpp b/src/inputmethod.cpp index 8ff0d7f1b8..ffa596121a 100644 --- a/src/inputmethod.cpp +++ b/src/inputmethod.cpp @@ -200,7 +200,9 @@ void InputMethod::handleFocusedSurfaceChanged() disconnect(m_trackedClient, &AbstractClient::frameGeometryChanged, this, &InputMethod::updateInputPanelState); } m_trackedClient = focusedClient; - connect(m_trackedClient, &AbstractClient::frameGeometryChanged, this, &InputMethod::updateInputPanelState, Qt::QueuedConnection); + if (m_trackedClient) { + connect(m_trackedClient, &AbstractClient::frameGeometryChanged, this, &InputMethod::updateInputPanelState, Qt::QueuedConnection); + } } updateInputPanelState(); } else {