diff --git a/shell_client.cpp b/shell_client.cpp index 13f0f8c2a1..4bfbb055e7 100644 --- a/shell_client.cpp +++ b/shell_client.cpp @@ -49,7 +49,7 @@ ShellClient::ShellClient(ShellSurfaceInterface *surface) ready_for_painting = false; } if (m_internalWindow) { - setGeometry(m_internalWindow->geometry()); + updateInternalWindowGeometry(); } else { setGeometry(QRect(QPoint(0, 0), m_clientSize)); } @@ -361,8 +361,18 @@ void ShellClient::findInternalWindow() continue; } m_internalWindow = w; + connect(m_internalWindow, &QWindow::xChanged, this, &ShellClient::updateInternalWindowGeometry); + connect(m_internalWindow, &QWindow::xChanged, this, &ShellClient::updateInternalWindowGeometry); return; } } +void ShellClient::updateInternalWindowGeometry() +{ + if (!m_internalWindow) { + return; + } + setGeometry(m_internalWindow->geometry()); +} + } diff --git a/shell_client.h b/shell_client.h index 8ccb6c0481..86e5a16c77 100644 --- a/shell_client.h +++ b/shell_client.h @@ -100,6 +100,7 @@ private: void destroyClient(); void createWindowId(); void findInternalWindow(); + void updateInternalWindowGeometry(); static void deleteClient(ShellClient *c); KWayland::Server::ShellSurfaceInterface *m_shellSurface;