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.
This commit is contained in:
Arjen Hiemstra 2022-07-13 15:23:13 +02:00
parent 2f4fa23e61
commit 2138a43392
2 changed files with 5 additions and 0 deletions

View file

@ -9,6 +9,8 @@
#include "internalwindow.h"
#include "scene.h"
#include <QOpenGLFramebufferObject>
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();
}
}

View file

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