[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    [kwin/scaling_merged] /: Set m_client size in surface normal co-ordinates
From:       David Edmundson <kde () davidedmundson ! co ! uk>
Date:       2016-11-24 20:48:39
Message-ID: E1cA0wh-0000TY-LG () code ! kde ! org
[Download RAW message or body]

Git commit d60663e9fbc380ac0fd1b43ceeb133880770aa93 by David Edmundson.
Committed on 23/11/2016 at 17:11.
Pushed by davidedmundson into branch 'scaling_merged'.

Set m_client size in surface normal co-ordinates

M  +3    -2    scene_qpainter.cpp
M  +7    -4    shell_client.cpp

https://commits.kde.org/kwin/d60663e9fbc380ac0fd1b43ceeb133880770aa93

diff --git a/scene_qpainter.cpp b/scene_qpainter.cpp
index feccf62..096b1e7 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 6f052b7..339428e 100644
--- a/shell_client.cpp
+++ b/shell_client.cpp
@@ -181,7 +181,7 @@ void ShellClient::init()
             setupWindowManagementInterface();
         }
         m_unmapped = false;
-        m_clientSize = s->buffer()->size();
+        m_clientSize = s->size();
     } else {
         ready_for_painting = false;
     }
@@ -366,8 +366,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());
@@ -388,8 +388,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()));


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic