Commit 20e314d1 authored by Martin Flöser's avatar Martin Flöser

Properly render XWayland windows in SceneQPainter

Summary:
The buffer for a XWayland window is larger than the actual size. Thus
we need to use the clientSize as reference, not the buffer size.

BUG: 382748

Test Plan: Test passes

Reviewers: #kwin, #plasma

Subscribers: plasma-devel, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D6952
parent afd52c18
......@@ -372,7 +372,6 @@ void SceneQPainterTest::testX11Window()
const QPoint startPos = client->pos() + client->clientPos();
auto image = scene->backend()->buffer();
QEXPECT_FAIL("", "BUG 382748", Continue);
QCOMPARE(image->copy(QRect(startPos, client->clientSize())), compareImage);
// and destroy the window again
......
......@@ -310,7 +310,12 @@ void SceneQPainter::Window::performPaint(int mask, QRegion region, WindowPaintDa
// render content
const QRect target = QRect(toplevel->clientPos(), toplevel->clientSize());
const QRect src = QRect(toplevel->clientPos() + toplevel->clientContentPos(), pixmap->image().size());
QSize srcSize = pixmap->image().size();
if (pixmap->surface() && pixmap->surface()->scale() == 1 && srcSize != toplevel->clientSize()) {
// special case for XWayland windows
srcSize = toplevel->clientSize();
}
const QRect src = QRect(toplevel->clientPos() + toplevel->clientContentPos(), srcSize);
painter->drawImage(target, pixmap->image(), src);
// render subsurfaces
......
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