Fix AbstractClient::sizeForClientSize

Summary:
The method is supposed to return the AbstractClient's size for a given
client size. That is the size including the window decoration.

The default implementation returned the passed in client size without
adjusting for the decoration. This resulted in ShellClient getting a
wrong size especially when AbstractClient::adjustedClientSize (which
calls sizeForClientSize) was called.

The result of the incorrect size was for example a shrinking of the
window when starting to resize a window.

BUG: 370345
FIXED-IN: 5.8.4

Reviewers: #kwin, #plasma_on_wayland, broulik, subdiff

Subscribers: plasma-devel, kwin

Tags: #plasma_on_wayland, #kwin

Differential Revision: https://phabricator.kde.org/D3414
icc-effect-5.14.5
Martin Gräßlin 2016-11-18 12:32:05 +01:00
parent fb69b791a1
commit 16c7650d76
2 changed files with 2 additions and 1 deletions

View File

@ -1146,7 +1146,7 @@ QSize AbstractClient::sizeForClientSize(const QSize &wsize, Sizemode mode, bool
{
Q_UNUSED(mode)
Q_UNUSED(noframe)
return wsize;
return wsize + QSize(borderLeft() + borderRight(), borderTop() + borderBottom());
}
void AbstractClient::addRepaintDuringGeometryUpdates()

View File

@ -334,6 +334,7 @@ void TestShellClient::testFullscreen()
QVERIFY(!c->isFullScreen());
QCOMPARE(c->clientSize(), QSize(100, 50));
QCOMPARE(c->isDecorated(), decoMode == ServerSideDecoration::Mode::Server);
QCOMPARE(c->sizeForClientSize(c->clientSize()), c->geometry().size());
QSignalSpy fullscreenChangedSpy(c, &ShellClient::fullScreenChanged);
QVERIFY(fullscreenChangedSpy.isValid());
QSignalSpy geometryChangedSpy(c, &ShellClient::geometryChanged);