From 2ff903e8b34b6f27fc3696a9ab969f91ce19e57e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Gr=C3=A4=C3=9Flin?= Date: Wed, 20 May 2015 08:27:48 +0200 Subject: [PATCH] [wayland] Sync ShellClient's geometry with internal QWindow's geometry Update geometry when the referenced internal QWindow changes position. This makes the close button in PresentWindows work. --- shell_client.cpp | 12 +++++++++++- shell_client.h | 1 + 2 files changed, 12 insertions(+), 1 deletion(-) 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;