Commit 16c7650d authored by Martin Flöser's avatar Martin Flöser

Fix AbstractClient::sizeForClientSize

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:
parent fb69b791
...@@ -1146,7 +1146,7 @@ QSize AbstractClient::sizeForClientSize(const QSize &wsize, Sizemode mode, bool ...@@ -1146,7 +1146,7 @@ QSize AbstractClient::sizeForClientSize(const QSize &wsize, Sizemode mode, bool
{ {
Q_UNUSED(mode) Q_UNUSED(mode)
Q_UNUSED(noframe) Q_UNUSED(noframe)
return wsize; return wsize + QSize(borderLeft() + borderRight(), borderTop() + borderBottom());
} }
void AbstractClient::addRepaintDuringGeometryUpdates() void AbstractClient::addRepaintDuringGeometryUpdates()
...@@ -334,6 +334,7 @@ void TestShellClient::testFullscreen() ...@@ -334,6 +334,7 @@ void TestShellClient::testFullscreen()
QVERIFY(!c->isFullScreen()); QVERIFY(!c->isFullScreen());
QCOMPARE(c->clientSize(), QSize(100, 50)); QCOMPARE(c->clientSize(), QSize(100, 50));
QCOMPARE(c->isDecorated(), decoMode == ServerSideDecoration::Mode::Server); QCOMPARE(c->isDecorated(), decoMode == ServerSideDecoration::Mode::Server);
QCOMPARE(c->sizeForClientSize(c->clientSize()), c->geometry().size());
QSignalSpy fullscreenChangedSpy(c, &ShellClient::fullScreenChanged); QSignalSpy fullscreenChangedSpy(c, &ShellClient::fullScreenChanged);
QVERIFY(fullscreenChangedSpy.isValid()); QVERIFY(fullscreenChangedSpy.isValid());
QSignalSpy geometryChangedSpy(c, &ShellClient::geometryChanged); QSignalSpy geometryChangedSpy(c, &ShellClient::geometryChanged);
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment