From 2138a43392aee749ff284ff399c4b59f3362e846 Mon Sep 17 00:00:00 2001 From: Arjen Hiemstra Date: Wed, 13 Jul 2022 15:23:13 +0200 Subject: [PATCH] Properly set m_size when updating SurfacePixmap{Wayland,Internal} Otherwise the size() getter in the base class outputs an invalid size and we can't really use it. --- src/surfaceitem_internal.cpp | 4 ++++ src/surfaceitem_wayland.cpp | 1 + 2 files changed, 5 insertions(+) diff --git a/src/surfaceitem_internal.cpp b/src/surfaceitem_internal.cpp index 52a46f8e42..29bb9a7a70 100644 --- a/src/surfaceitem_internal.cpp +++ b/src/surfaceitem_internal.cpp @@ -9,6 +9,8 @@ #include "internalwindow.h" #include "scene.h" +#include + namespace KWin { @@ -71,9 +73,11 @@ void SurfacePixmapInternal::update() if (window->internalFramebufferObject()) { m_fbo = window->internalFramebufferObject(); + m_size = m_fbo->size(); m_hasAlphaChannel = true; } else if (!window->internalImageObject().isNull()) { m_rasterBuffer = window->internalImageObject(); + m_size = m_rasterBuffer.size(); m_hasAlphaChannel = m_rasterBuffer.hasAlphaChannel(); } } diff --git a/src/surfaceitem_wayland.cpp b/src/surfaceitem_wayland.cpp index eb56e51e78..2199edb8d8 100644 --- a/src/surfaceitem_wayland.cpp +++ b/src/surfaceitem_wayland.cpp @@ -193,6 +193,7 @@ void SurfacePixmapWayland::setBuffer(KWaylandServer::ClientBuffer *buffer) if (m_buffer) { m_buffer->ref(); m_hasAlphaChannel = m_buffer->hasAlphaChannel(); + m_size = m_buffer->size(); } }