From 5c0c0cdb912c5554784d05e2b418b12230339cde Mon Sep 17 00:00:00 2001 From: David Edmundson Date: Fri, 4 Nov 2016 16:52:49 +0000 Subject: [PATCH] Set m_client size in global compositor co-ordinates KWin wants to deal with the post-scaled down client size, not the texture size. Reviewers: #plasma Subscribers: plasma-devel, kwin Tags: #kwin Differential Revision: https://phabricator.kde.org/D3494 --- scene_qpainter.cpp | 5 +++-- shell_client.cpp | 13 ++++++++----- 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/scene_qpainter.cpp b/scene_qpainter.cpp index feccf6223d..096b1e7126 100644 --- a/scene_qpainter.cpp +++ b/scene_qpainter.cpp @@ -308,8 +308,9 @@ void SceneQPainter::Window::performPaint(int mask, QRegion region, WindowPaintDa 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 index c4322f1488..c0698f144c 100644 --- a/shell_client.cpp +++ b/shell_client.cpp @@ -189,7 +189,7 @@ void ShellClient::init() setupWindowManagementInterface(); } m_unmapped = false; - m_clientSize = s->buffer()->size(); + m_clientSize = s->size(); } else { ready_for_painting = false; } @@ -207,7 +207,7 @@ void ShellClient::init() connect(s, &SurfaceInterface::sizeChanged, this, [this] { - m_clientSize = surface()->buffer()->size(); + m_clientSize = surface()->size(); doSetGeometry(QRect(geom.topLeft(), m_clientSize + QSize(borderLeft() + borderRight(), borderTop() + borderBottom()))); } ); @@ -375,8 +375,8 @@ void ShellClient::setOpacity(double opacity) 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()); @@ -397,8 +397,11 @@ void ShellClient::setInternalFramebufferObject(const QSharedPointersize(); + markAsMapped(); doSetGeometry(QRect(geom.topLeft(), m_clientSize)); Toplevel::setInternalFramebufferObject(fbo); Toplevel::addDamage(QRegion(0, 0, width(), height()));