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
This commit is contained in:
David Edmundson 2016-11-04 16:52:49 +00:00
parent fd58c68ba5
commit 5c0c0cdb91
2 changed files with 11 additions and 7 deletions

View file

@ -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();

View file

@ -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 QSharedPointer<QOpenGLFrame
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()));