From 1fb2eace3fbfc6645e024aa0f5003306ac60a417 Mon Sep 17 00:00:00 2001 From: Roman Gilg Date: Thu, 24 May 2018 09:58:43 +0200 Subject: [PATCH] Avoid invalid geometry of internal clients through plasma surface interface Summary: Internal KWin windows might be not in sync with their PlasmaShellSurface. This could be a problem in general, but for now atleast guard against invalid setPosition requests. BUG: 386304 Test Plan: Manually Reviewers: #kwin, davidedmundson Subscribers: davidedmundson, ngraham, graesslin, kwin Tags: #kwin Maniphest Tasks: T8771 Differential Revision: https://phabricator.kde.org/D13084 --- shell_client.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/shell_client.cpp b/shell_client.cpp index a3a80cd532..9a184caec4 100644 --- a/shell_client.cpp +++ b/shell_client.cpp @@ -1234,7 +1234,12 @@ void ShellClient::installPlasmaShellSurface(PlasmaShellSurfaceInterface *surface { m_plasmaShellSurface = surface; auto updatePosition = [this, surface] { - doSetGeometry(QRect(surface->position(), m_clientSize + QSize(borderLeft() + borderRight(), borderTop() + borderBottom()))); + QRect rect = QRect(surface->position(), m_clientSize + QSize(borderLeft() + borderRight(), borderTop() + borderBottom())); + // Shell surfaces of internal windows are sometimes desync to current value. + // Make sure to not set window geometry of internal windows to invalid values (bug 386304) + if (!m_internal || rect.isValid()) { + doSetGeometry(rect); + } }; auto updateRole = [this, surface] { NET::WindowType type = NET::Unknown;