From 823deba1d6822721c9fc66c1884306c373bca70d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Gr=C3=A4=C3=9Flin?= Date: Fri, 5 Jul 2013 10:37:21 +0200 Subject: [PATCH] [kwin/scene_qpainter] Use size of shell surface as back buffer size Most important connect to the surface size changed signal so that we can create a new back buffer which matches the size of the surface. --- scene_qpainter.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/scene_qpainter.cpp b/scene_qpainter.cpp index 85e674ac7c..551ab58dc0 100644 --- a/scene_qpainter.cpp +++ b/scene_qpainter.cpp @@ -98,10 +98,12 @@ WaylandQPainterBackend::WaylandQPainterBackend() : QPainterBackend() , m_lastFrameRendered(true) , m_needsFullRepaint(true) - , m_backBuffer(QImage(QSize(displayWidth(), displayHeight()), QImage::Format_ARGB32_Premultiplied)) + , m_backBuffer(QImage(QSize(), QImage::Format_ARGB32_Premultiplied)) , m_buffer(NULL) { connect(Wayland::WaylandBackend::self()->shmPool(), SIGNAL(poolResized()), SLOT(remapBuffer())); + connect(Wayland::WaylandBackend::self(), &Wayland::WaylandBackend::shellSurfaceSizeChanged, + this, &WaylandQPainterBackend::screenGeometryChanged); } WaylandQPainterBackend::~WaylandQPainterBackend() @@ -172,7 +174,7 @@ void WaylandQPainterBackend::prepareRenderingFrame() } } m_buffer = NULL; - const QSize size(displayWidth(), displayHeight()); + const QSize size(Wayland::WaylandBackend::self()->shellSurfaceSize()); m_buffer = Wayland::WaylandBackend::self()->shmPool()->getBuffer(size, size.width() * 4); if (!m_buffer) { qDebug() << "Did not get a new Buffer from Shm Pool";