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
icc-effect-5.14.5
Roman Gilg 2018-05-24 09:58:43 +02:00
parent 1f4682f249
commit 1fb2eace3f
1 changed files with 6 additions and 1 deletions

View File

@ -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;