diff --git a/scene_qpainter.cpp b/scene_qpainter.cpp --- a/scene_qpainter.cpp +++ b/scene_qpainter.cpp @@ -308,8 +308,9 @@ renderWindowDecorations(painter); // render content - const QRect src = QRect(toplevel->clientPos() + toplevel->clientContentPos(), toplevel->clientSize()); - painter->drawImage(toplevel->clientPos(), pixmap->image(), src); + const QRect target = QRect(toplevel->clientPos(), toplevel->clientSize()); + const QRect src = QRect(toplevel->clientPos() + toplevel->clientContentPos(), pixmap->image().size()); + painter->drawImage(target, pixmap->image(), src); // render subsurfaces const auto &children = pixmap->children(); diff --git a/shell_client.cpp b/shell_client.cpp --- a/shell_client.cpp +++ b/shell_client.cpp @@ -186,7 +186,7 @@ setupWindowManagementInterface(); } m_unmapped = false; - m_clientSize = s->buffer()->size(); + m_clientSize = s->size(); } else { ready_for_painting = false; } @@ -371,8 +371,8 @@ void ShellClient::addDamage(const QRegion &damage) { auto s = surface(); - if (s->buffer()->size().isValid()) { - m_clientSize = s->buffer()->size(); + if (s->size().isValid()) { + m_clientSize = s->size(); QPoint position = geom.topLeft(); if (m_positionAfterResize.isValid()) { addLayerRepaint(geometry()); @@ -393,8 +393,11 @@ unmap(); return; } - markAsMapped(); + + //Kwin currently scales internal windows to 1, so this is currently always correct + //when that changes, this needs adjusting m_clientSize = fbo->size(); + markAsMapped(); doSetGeometry(QRect(geom.topLeft(), m_clientSize)); Toplevel::setInternalFramebufferObject(fbo); Toplevel::addDamage(QRegion(0, 0, width(), height()));