diff --git a/autotests/integration/pointer_input.cpp b/autotests/integration/pointer_input.cpp index 7d23db9f36..7b1f7a27a1 100644 --- a/autotests/integration/pointer_input.cpp +++ b/autotests/integration/pointer_input.cpp @@ -31,7 +31,6 @@ #include #include -#include #include #include diff --git a/autotests/integration/scene_qpainter_test.cpp b/autotests/integration/scene_qpainter_test.cpp index f9f0620aa9..08373703b7 100644 --- a/autotests/integration/scene_qpainter_test.cpp +++ b/autotests/integration/scene_qpainter_test.cpp @@ -22,7 +22,7 @@ #include #include #include -#include +#include #include #include @@ -347,7 +347,8 @@ void SceneQPainterTest::testX11Window() QVERIFY(waitForXwaylandBuffer(client, client->size())); QImage compareImage(client->clientSize(), QImage::Format_RGB32); compareImage.fill(Qt::white); - QCOMPARE(client->surface()->buffer()->data().copy(QRect(client->clientPos(), client->clientSize())), compareImage); + auto buffer = qobject_cast(client->surface()->buffer()); + QCOMPARE(buffer->data().copy(QRect(client->clientPos(), client->clientSize())), compareImage); // enough time for rendering the window QTest::qWait(100); diff --git a/src/debug_console.cpp b/src/debug_console.cpp index 977471e430..5fc3c93e14 100644 --- a/src/debug_console.cpp +++ b/src/debug_console.cpp @@ -27,7 +27,7 @@ #include "ui_debug_console.h" // KWayland -#include +#include #include #include #include @@ -1422,10 +1422,8 @@ QVariant SurfaceTreeModel::data(const QModelIndex &index, int role) const .arg(surface->client()->processId()) .arg(surface->id()); } else if (role == Qt::DecorationRole) { - if (auto buffer = surface->buffer()) { - if (buffer->shmBuffer()) { - return buffer->data().scaled(QSize(64, 64), Qt::KeepAspectRatio); - } + if (auto buffer = qobject_cast(surface->buffer())) { + return buffer->data().scaled(QSize(64, 64), Qt::KeepAspectRatio); } } } diff --git a/src/input.cpp b/src/input.cpp index e16e870373..14bf7e6320 100644 --- a/src/input.cpp +++ b/src/input.cpp @@ -43,7 +43,7 @@ #include #include #include -#include +#include #include #include #include @@ -1594,7 +1594,7 @@ public: private: void refresh() { - auto buffer = m_surface->buffer(); + auto buffer = qobject_cast(m_surface->buffer()); if (!buffer) { updateCursor({}, {}); return; diff --git a/src/linux_dmabuf.cpp b/src/linux_dmabuf.cpp index 0e30322dd3..0549e82c0a 100644 --- a/src/linux_dmabuf.cpp +++ b/src/linux_dmabuf.cpp @@ -10,56 +10,40 @@ #include "wayland_server.h" -#include - namespace KWin { -DmabufBuffer::DmabufBuffer(const QVector &planes, - uint32_t format, - const QSize &size, - Flags flags) - : KWaylandServer::LinuxDmabufUnstableV1Buffer(format, size) - , m_planes(planes) - , m_format(format) - , m_size(size) - , m_flags(flags) +LinuxDmaBufV1ClientBuffer::LinuxDmaBufV1ClientBuffer(const QVector &planes, + quint32 format, + const QSize &size, + quint32 flags) + : KWaylandServer::LinuxDmaBufV1ClientBuffer(size, format, flags, planes) { waylandServer()->addLinuxDmabufBuffer(this); } -DmabufBuffer::~DmabufBuffer() +LinuxDmaBufV1ClientBuffer::~LinuxDmaBufV1ClientBuffer() { - // Close all open file descriptors - for (int i = 0; i < m_planes.count(); i++) { - if (m_planes[i].fd != -1) - ::close(m_planes[i].fd); - m_planes[i].fd = -1; - } if (waylandServer()) { waylandServer()->removeLinuxDmabufBuffer(this); } } -LinuxDmabuf::LinuxDmabuf() - : KWaylandServer::LinuxDmabufUnstableV1Interface::Impl() +LinuxDmaBufV1RendererInterface::LinuxDmaBufV1RendererInterface() { Q_ASSERT(waylandServer()); - waylandServer()->linuxDmabuf()->setImpl(this); + waylandServer()->linuxDmabuf()->setRendererInterface(this); } -LinuxDmabuf::~LinuxDmabuf() +LinuxDmaBufV1RendererInterface::~LinuxDmaBufV1RendererInterface() { - waylandServer()->linuxDmabuf()->setImpl(nullptr); + waylandServer()->linuxDmabuf()->setRendererInterface(nullptr); } -using Plane = KWaylandServer::LinuxDmabufUnstableV1Interface::Plane; -using Flags = KWaylandServer::LinuxDmabufUnstableV1Interface::Flags; - -KWaylandServer::LinuxDmabufUnstableV1Buffer* LinuxDmabuf::importBuffer(const QVector &planes, - uint32_t format, - const QSize &size, - Flags flags) +KWaylandServer::LinuxDmaBufV1ClientBuffer *LinuxDmaBufV1RendererInterface::importBuffer(const QVector &planes, + quint32 format, + const QSize &size, + quint32 flags) { Q_UNUSED(planes) Q_UNUSED(format) @@ -69,7 +53,7 @@ KWaylandServer::LinuxDmabufUnstableV1Buffer* LinuxDmabuf::importBuffer(const QVe return nullptr; } -void LinuxDmabuf::setSupportedFormatsAndModifiers(QHash > &set) +void LinuxDmaBufV1RendererInterface::setSupportedFormatsAndModifiers(const QHash> &set) { waylandServer()->linuxDmabuf()->setSupportedFormatsWithModifiers(set); } diff --git a/src/linux_dmabuf.h b/src/linux_dmabuf.h index 8bb435e002..53a144669e 100644 --- a/src/linux_dmabuf.h +++ b/src/linux_dmabuf.h @@ -10,54 +10,34 @@ #include -#include - -#include +#include namespace KWin { -class KWIN_EXPORT DmabufBuffer : public KWaylandServer::LinuxDmabufUnstableV1Buffer +class KWIN_EXPORT LinuxDmaBufV1ClientBuffer : public KWaylandServer::LinuxDmaBufV1ClientBuffer { public: - using Plane = KWaylandServer::LinuxDmabufUnstableV1Interface::Plane; - using Flags = KWaylandServer::LinuxDmabufUnstableV1Interface::Flags; - - DmabufBuffer(const QVector &planes, - uint32_t format, - const QSize &size, - Flags flags); - - ~DmabufBuffer() override; - - const QVector &planes() const { return m_planes; } - uint32_t format() const { return m_format; } - QSize size() const { return m_size; } - Flags flags() const { return m_flags; } - -private: - QVector m_planes; - uint32_t m_format; - QSize m_size; - Flags m_flags; + LinuxDmaBufV1ClientBuffer(const QVector &planes, + quint32 format, + const QSize &size, + quint32 flags); + ~LinuxDmaBufV1ClientBuffer() override; }; -class KWIN_EXPORT LinuxDmabuf : public KWaylandServer::LinuxDmabufUnstableV1Interface::Impl +class KWIN_EXPORT LinuxDmaBufV1RendererInterface : public KWaylandServer::LinuxDmaBufV1ClientBufferIntegration::RendererInterface { public: - using Plane = KWaylandServer::LinuxDmabufUnstableV1Interface::Plane; - using Flags = KWaylandServer::LinuxDmabufUnstableV1Interface::Flags; + explicit LinuxDmaBufV1RendererInterface(); + ~LinuxDmaBufV1RendererInterface() override; - explicit LinuxDmabuf(); - ~LinuxDmabuf() override; - - KWaylandServer::LinuxDmabufUnstableV1Buffer *importBuffer(const QVector &planes, - uint32_t format, - const QSize &size, - Flags flags) override; + KWaylandServer::LinuxDmaBufV1ClientBuffer *importBuffer(const QVector &planes, + quint32 format, + const QSize &size, + quint32 flags) override; protected: - void setSupportedFormatsAndModifiers(QHash > &set); + void setSupportedFormatsAndModifiers(const QHash> &set); }; } diff --git a/src/platformsupport/scenes/opengl/basiceglsurfacetexture_wayland.cpp b/src/platformsupport/scenes/opengl/basiceglsurfacetexture_wayland.cpp index 688d142c13..b2d5b4c929 100644 --- a/src/platformsupport/scenes/opengl/basiceglsurfacetexture_wayland.cpp +++ b/src/platformsupport/scenes/opengl/basiceglsurfacetexture_wayland.cpp @@ -11,8 +11,9 @@ #include "logging.h" #include "surfaceitem_wayland.h" -#include -#include +#include +#include +#include namespace KWin { @@ -35,16 +36,14 @@ AbstractEglBackend *BasicEGLSurfaceTextureWayland::backend() const bool BasicEGLSurfaceTextureWayland::create() { - KWaylandServer::BufferInterface *buffer = m_pixmap->buffer(); - if (Q_UNLIKELY(!buffer)) { - return false; - } - if (buffer->linuxDmabufBuffer()) { + if (auto buffer = qobject_cast(m_pixmap->buffer())) { return loadDmabufTexture(buffer); - } else if (buffer->shmBuffer()) { + } else if (auto buffer = qobject_cast(m_pixmap->buffer())) { return loadShmTexture(buffer); - } else { + } else if (auto buffer = qobject_cast(m_pixmap->buffer())) { return loadEglTexture(buffer); + } else { + return false; } } @@ -60,20 +59,16 @@ void BasicEGLSurfaceTextureWayland::destroy() void BasicEGLSurfaceTextureWayland::update(const QRegion ®ion) { - KWaylandServer::BufferInterface *buffer = m_pixmap->buffer(); - if (Q_UNLIKELY(!buffer)) { - return; - } - if (buffer->linuxDmabufBuffer()) { + if (auto buffer = qobject_cast(m_pixmap->buffer())) { updateDmabufTexture(buffer); - } else if (buffer->shmBuffer()) { + } else if (auto buffer = qobject_cast(m_pixmap->buffer())) { updateShmTexture(buffer, region); - } else { + } else if (auto buffer = qobject_cast(m_pixmap->buffer())) { updateEglTexture(buffer); } } -bool BasicEGLSurfaceTextureWayland::loadShmTexture(KWaylandServer::BufferInterface *buffer) +bool BasicEGLSurfaceTextureWayland::loadShmTexture(KWaylandServer::ShmClientBuffer *buffer) { const QImage &image = buffer->data(); if (Q_UNLIKELY(image.isNull())) { @@ -89,7 +84,7 @@ bool BasicEGLSurfaceTextureWayland::loadShmTexture(KWaylandServer::BufferInterfa return true; } -void BasicEGLSurfaceTextureWayland::updateShmTexture(KWaylandServer::BufferInterface *buffer, const QRegion ®ion) +void BasicEGLSurfaceTextureWayland::updateShmTexture(KWaylandServer::ShmClientBuffer *buffer, const QRegion ®ion) { if (Q_UNLIKELY(m_bufferType != BufferType::Shm)) { destroy(); @@ -108,7 +103,7 @@ void BasicEGLSurfaceTextureWayland::updateShmTexture(KWaylandServer::BufferInter } } -bool BasicEGLSurfaceTextureWayland::loadEglTexture(KWaylandServer::BufferInterface *buffer) +bool BasicEGLSurfaceTextureWayland::loadEglTexture(KWaylandServer::DrmClientBuffer *buffer) { const AbstractEglBackendFunctions *funcs = backend()->functions(); if (Q_UNLIKELY(!funcs->eglQueryWaylandBufferWL)) { @@ -137,13 +132,16 @@ bool BasicEGLSurfaceTextureWayland::loadEglTexture(KWaylandServer::BufferInterfa return true; } -void BasicEGLSurfaceTextureWayland::updateEglTexture(KWaylandServer::BufferInterface *buffer) +void BasicEGLSurfaceTextureWayland::updateEglTexture(KWaylandServer::DrmClientBuffer *buffer) { if (Q_UNLIKELY(m_bufferType != BufferType::Egl)) { destroy(); create(); return; } + if (Q_UNLIKELY(!buffer->resource())) { + return; + } m_texture->bind(); EGLImageKHR image = attach(buffer); @@ -156,9 +154,9 @@ void BasicEGLSurfaceTextureWayland::updateEglTexture(KWaylandServer::BufferInter } } -bool BasicEGLSurfaceTextureWayland::loadDmabufTexture(KWaylandServer::BufferInterface *buffer) +bool BasicEGLSurfaceTextureWayland::loadDmabufTexture(KWaylandServer::LinuxDmaBufV1ClientBuffer *buffer) { - auto dmabuf = static_cast(buffer->linuxDmabufBuffer()); + auto dmabuf = static_cast(buffer); if (Q_UNLIKELY(dmabuf->images().constFirst() == EGL_NO_IMAGE_KHR)) { qCritical(KWIN_OPENGL) << "Invalid dmabuf-based wl_buffer"; return false; @@ -172,13 +170,13 @@ bool BasicEGLSurfaceTextureWayland::loadDmabufTexture(KWaylandServer::BufferInte m_texture->bind(); glEGLImageTargetTexture2DOES(GL_TEXTURE_2D, static_cast(dmabuf->images().constFirst())); m_texture->unbind(); - m_texture->setYInverted(!(dmabuf->flags() & KWaylandServer::LinuxDmabufUnstableV1Interface::YInverted)); + m_texture->setYInverted(dmabuf->origin() == KWaylandServer::ClientBuffer::Origin::TopLeft); m_bufferType = BufferType::DmaBuf; return true; } -void BasicEGLSurfaceTextureWayland::updateDmabufTexture(KWaylandServer::BufferInterface *buffer) +void BasicEGLSurfaceTextureWayland::updateDmabufTexture(KWaylandServer::LinuxDmaBufV1ClientBuffer *buffer) { if (Q_UNLIKELY(m_bufferType != BufferType::DmaBuf)) { destroy(); @@ -186,35 +184,22 @@ void BasicEGLSurfaceTextureWayland::updateDmabufTexture(KWaylandServer::BufferIn return; } - auto dmabuf = static_cast(buffer->linuxDmabufBuffer()); + auto dmabuf = static_cast(buffer); m_texture->bind(); glEGLImageTargetTexture2DOES(GL_TEXTURE_2D, static_cast(dmabuf->images().constFirst())); m_texture->unbind(); // The origin in a dmabuf-buffer is at the upper-left corner, so the meaning // of Y-inverted is the inverse of OpenGL. - m_texture->setYInverted(!(dmabuf->flags() & KWaylandServer::LinuxDmabufUnstableV1Interface::YInverted)); + m_texture->setYInverted(dmabuf->origin() == KWaylandServer::ClientBuffer::Origin::TopLeft); } -EGLImageKHR BasicEGLSurfaceTextureWayland::attach(KWaylandServer::BufferInterface *buffer) +EGLImageKHR BasicEGLSurfaceTextureWayland::attach(KWaylandServer::DrmClientBuffer *buffer) { - const AbstractEglBackendFunctions *funcs = backend()->functions(); - - EGLint format; - funcs->eglQueryWaylandBufferWL(backend()->eglDisplay(), buffer->resource(), - EGL_TEXTURE_FORMAT, &format); - if (format != EGL_TEXTURE_RGB && format != EGL_TEXTURE_RGBA) { - qCDebug(KWIN_OPENGL) << "Unsupported texture format: " << format; + if (buffer->textureFormat() != EGL_TEXTURE_RGB && buffer->textureFormat() != EGL_TEXTURE_RGBA) { + qCDebug(KWIN_OPENGL) << "Unsupported texture format: " << buffer->textureFormat(); return EGL_NO_IMAGE_KHR; } - EGLint yInverted; - if (!funcs->eglQueryWaylandBufferWL(backend()->eglDisplay(), buffer->resource(), - EGL_WAYLAND_Y_INVERTED_WL, &yInverted)) { - // If EGL_WAYLAND_Y_INVERTED_WL is not supported wl_buffer should be treated as - // if value were EGL_TRUE. - yInverted = EGL_TRUE; - } - const EGLint attribs[] = { EGL_WAYLAND_PLANE_WL, 0, EGL_NONE @@ -224,7 +209,7 @@ EGLImageKHR BasicEGLSurfaceTextureWayland::attach(KWaylandServer::BufferInterfac static_cast(buffer->resource()), attribs); if (image != EGL_NO_IMAGE_KHR) { glEGLImageTargetTexture2DOES(GL_TEXTURE_2D, static_cast(image)); - m_texture->setYInverted(yInverted); + m_texture->setYInverted(buffer->origin() == KWaylandServer::ClientBuffer::Origin::TopLeft); } return image; } diff --git a/src/platformsupport/scenes/opengl/basiceglsurfacetexture_wayland.h b/src/platformsupport/scenes/opengl/basiceglsurfacetexture_wayland.h index f7667094f5..22669ad468 100644 --- a/src/platformsupport/scenes/opengl/basiceglsurfacetexture_wayland.h +++ b/src/platformsupport/scenes/opengl/basiceglsurfacetexture_wayland.h @@ -12,7 +12,9 @@ namespace KWaylandServer { -class BufferInterface; +class DrmClientBuffer; +class ShmClientBuffer; +class LinuxDmaBufV1ClientBuffer; } namespace KWin @@ -32,13 +34,13 @@ public: void update(const QRegion ®ion) override; private: - bool loadShmTexture(KWaylandServer::BufferInterface *buffer); - void updateShmTexture(KWaylandServer::BufferInterface *buffer, const QRegion ®ion); - bool loadEglTexture(KWaylandServer::BufferInterface *buffer); - void updateEglTexture(KWaylandServer::BufferInterface *buffer); - bool loadDmabufTexture(KWaylandServer::BufferInterface *buffer); - void updateDmabufTexture(KWaylandServer::BufferInterface *buffer); - EGLImageKHR attach(KWaylandServer::BufferInterface *buffer); + bool loadShmTexture(KWaylandServer::ShmClientBuffer *buffer); + void updateShmTexture(KWaylandServer::ShmClientBuffer *buffer, const QRegion ®ion); + bool loadEglTexture(KWaylandServer::DrmClientBuffer *buffer); + void updateEglTexture(KWaylandServer::DrmClientBuffer *buffer); + bool loadDmabufTexture(KWaylandServer::LinuxDmaBufV1ClientBuffer *buffer); + void updateDmabufTexture(KWaylandServer::LinuxDmaBufV1ClientBuffer *buffer); + EGLImageKHR attach(KWaylandServer::DrmClientBuffer *buffer); void destroy(); enum class BufferType { diff --git a/src/platformsupport/scenes/opengl/egl_dmabuf.cpp b/src/platformsupport/scenes/opengl/egl_dmabuf.cpp index 5bc8495ec0..d794b344f5 100644 --- a/src/platformsupport/scenes/opengl/egl_dmabuf.cpp +++ b/src/platformsupport/scenes/opengl/egl_dmabuf.cpp @@ -122,10 +122,10 @@ YuvFormat yuvFormats[] = { }; EglDmabufBuffer::EglDmabufBuffer(EGLImage image, - const QVector &planes, + const QVector &planes, uint32_t format, const QSize &size, - Flags flags, + quint32 flags, EglDmabuf *interfaceImpl) : EglDmabufBuffer(planes, format, size, flags, interfaceImpl) { @@ -134,12 +134,12 @@ EglDmabufBuffer::EglDmabufBuffer(EGLImage image, } -EglDmabufBuffer::EglDmabufBuffer(const QVector &planes, +EglDmabufBuffer::EglDmabufBuffer(const QVector &planes, uint32_t format, const QSize &size, - Flags flags, + quint32 flags, EglDmabuf *interfaceImpl) - : DmabufBuffer(planes, format, size, flags) + : LinuxDmaBufV1ClientBuffer(planes, format, size, flags) , m_interfaceImpl(interfaceImpl) { m_importType = ImportType::Conversion; @@ -168,10 +168,7 @@ void EglDmabufBuffer::removeImages() m_images.clear(); } -using Plane = KWaylandServer::LinuxDmabufUnstableV1Interface::Plane; -using Flags = KWaylandServer::LinuxDmabufUnstableV1Interface::Flags; - -EGLImage EglDmabuf::createImage(const QVector &planes, +EGLImage EglDmabuf::createImage(const QVector &planes, uint32_t format, const QSize &size) { @@ -248,10 +245,10 @@ EGLImage EglDmabuf::createImage(const QVector &planes, return image; } -KWaylandServer::LinuxDmabufUnstableV1Buffer* EglDmabuf::importBuffer(const QVector &planes, - uint32_t format, - const QSize &size, - Flags flags) +KWaylandServer::LinuxDmaBufV1ClientBuffer *EglDmabuf::importBuffer(const QVector &planes, + quint32 format, + const QSize &size, + quint32 flags) { Q_ASSERT(planes.count() > 0); @@ -268,10 +265,10 @@ KWaylandServer::LinuxDmabufUnstableV1Buffer* EglDmabuf::importBuffer(const QVect return nullptr; } -KWaylandServer::LinuxDmabufUnstableV1Buffer* EglDmabuf::yuvImport(const QVector &planes, - uint32_t format, - const QSize &size, - Flags flags) +KWaylandServer::LinuxDmaBufV1ClientBuffer *EglDmabuf::yuvImport(const QVector &planes, + quint32 format, + const QSize &size, + quint32 flags) { YuvFormat yuvFormat; for (YuvFormat f : yuvFormats) { @@ -291,7 +288,7 @@ KWaylandServer::LinuxDmabufUnstableV1Buffer* EglDmabuf::yuvImport(const QVector< for (int i = 0; i < yuvFormat.outputPlanes; i++) { int planeIndex = yuvFormat.planes[i].planeIndex; - Plane plane = { + KWaylandServer::LinuxDmaBufV1Plane plane = { planes[planeIndex].fd, planes[planeIndex].offset, planes[planeIndex].stride, @@ -300,7 +297,7 @@ KWaylandServer::LinuxDmabufUnstableV1Buffer* EglDmabuf::yuvImport(const QVector< const auto planeFormat = yuvFormat.planes[i].format; const auto planeSize = QSize(size.width() / yuvFormat.planes[i].widthDivisor, size.height() / yuvFormat.planes[i].heightDivisor); - auto *image = createImage(QVector(1, plane), + auto *image = createImage(QVector(1, plane), planeFormat, planeSize); if (!image) { @@ -332,8 +329,7 @@ EglDmabuf* EglDmabuf::factory(AbstractEglBackend *backend) } EglDmabuf::EglDmabuf(AbstractEglBackend *backend) - : LinuxDmabuf() - , m_backend(backend) + : m_backend(backend) { auto prevBuffersSet = waylandServer()->linuxDmabufBuffers(); for (auto *buffer : prevBuffersSet) { @@ -439,7 +435,7 @@ void EglDmabuf::setSupportedFormatsAndModifiers() set.insert(format, QSet()); } - LinuxDmabuf::setSupportedFormatsAndModifiers(set); + LinuxDmaBufV1RendererInterface::setSupportedFormatsAndModifiers(set); } } diff --git a/src/platformsupport/scenes/opengl/egl_dmabuf.h b/src/platformsupport/scenes/opengl/egl_dmabuf.h index 977d2d728f..9734cb34c6 100644 --- a/src/platformsupport/scenes/opengl/egl_dmabuf.h +++ b/src/platformsupport/scenes/opengl/egl_dmabuf.h @@ -19,28 +19,25 @@ namespace KWin { class EglDmabuf; -class EglDmabufBuffer : public DmabufBuffer +class EglDmabufBuffer : public LinuxDmaBufV1ClientBuffer { public: - using Plane = KWaylandServer::LinuxDmabufUnstableV1Interface::Plane; - using Flags = KWaylandServer::LinuxDmabufUnstableV1Interface::Flags; - enum class ImportType { Direct, Conversion }; EglDmabufBuffer(EGLImage image, - const QVector &planes, - uint32_t format, + const QVector &planes, + quint32 format, const QSize &size, - Flags flags, + quint32 flags, EglDmabuf *interfaceImpl); - EglDmabufBuffer(const QVector &planes, - uint32_t format, + EglDmabufBuffer(const QVector &planes, + quint32 format, const QSize &size, - Flags flags, + quint32 flags, EglDmabuf *interfaceImpl); ~EglDmabufBuffer() override; @@ -57,31 +54,28 @@ private: ImportType m_importType; }; -class EglDmabuf : public LinuxDmabuf +class EglDmabuf : public LinuxDmaBufV1RendererInterface { public: - using Plane = KWaylandServer::LinuxDmabufUnstableV1Interface::Plane; - using Flags = KWaylandServer::LinuxDmabufUnstableV1Interface::Flags; - static EglDmabuf* factory(AbstractEglBackend *backend); explicit EglDmabuf(AbstractEglBackend *backend); ~EglDmabuf() override; - KWaylandServer::LinuxDmabufUnstableV1Buffer *importBuffer(const QVector &planes, - uint32_t format, - const QSize &size, - Flags flags) override; + KWaylandServer::LinuxDmaBufV1ClientBuffer *importBuffer(const QVector &planes, + quint32 format, + const QSize &size, + quint32 flags) override; private: - EGLImage createImage(const QVector &planes, + EGLImage createImage(const QVector &planes, uint32_t format, const QSize &size); - KWaylandServer::LinuxDmabufUnstableV1Buffer *yuvImport(const QVector &planes, - uint32_t format, - const QSize &size, - Flags flags); + KWaylandServer::LinuxDmaBufV1ClientBuffer *yuvImport(const QVector &planes, + quint32 format, + const QSize &size, + quint32 flags); void setSupportedFormatsAndModifiers(); diff --git a/src/platformsupport/scenes/qpainter/platformqpaintersurfacetexture_wayland.cpp b/src/platformsupport/scenes/qpainter/platformqpaintersurfacetexture_wayland.cpp index 6dce845f6b..e9e78990c0 100644 --- a/src/platformsupport/scenes/qpainter/platformqpaintersurfacetexture_wayland.cpp +++ b/src/platformsupport/scenes/qpainter/platformqpaintersurfacetexture_wayland.cpp @@ -7,7 +7,7 @@ #include "platformqpaintersurfacetexture_wayland.h" #include "surfaceitem_wayland.h" -#include +#include #include #include @@ -24,7 +24,7 @@ PlatformQPainterSurfaceTextureWayland::PlatformQPainterSurfaceTextureWayland(QPa bool PlatformQPainterSurfaceTextureWayland::create() { - KWaylandServer::BufferInterface *buffer = m_pixmap->buffer(); + auto buffer = qobject_cast(m_pixmap->buffer()); if (Q_LIKELY(buffer)) { // The buffer data is copied as the buffer interface returns a QImage // which doesn't own the data of the underlying wl_shm_buffer object. @@ -35,7 +35,7 @@ bool PlatformQPainterSurfaceTextureWayland::create() void PlatformQPainterSurfaceTextureWayland::update(const QRegion ®ion) { - KWaylandServer::BufferInterface *buffer = m_pixmap->buffer(); + auto buffer = qobject_cast(m_pixmap->buffer()); if (Q_UNLIKELY(!buffer)) { return; } diff --git a/src/plugins/platforms/drm/drm_buffer_gbm.cpp b/src/plugins/platforms/drm/drm_buffer_gbm.cpp index 55dd4609d3..84fc554853 100644 --- a/src/plugins/platforms/drm/drm_buffer_gbm.cpp +++ b/src/plugins/platforms/drm/drm_buffer_gbm.cpp @@ -22,7 +22,7 @@ #include #include // KWaylandServer -#include "KWaylandServer/buffer_interface.h" +#include "KWaylandServer/clientbuffer.h" #include namespace KWin @@ -35,14 +35,13 @@ GbmBuffer::GbmBuffer(GbmSurface *surface, gbm_bo *bo) m_stride = gbm_bo_get_stride(m_bo); } -GbmBuffer::GbmBuffer(gbm_bo *buffer, KWaylandServer::BufferInterface *bufferInterface) +GbmBuffer::GbmBuffer(gbm_bo *buffer, KWaylandServer::ClientBuffer *clientBuffer) : m_bo(buffer) - , m_bufferInterface(bufferInterface) + , m_clientBuffer(clientBuffer) , m_stride(gbm_bo_get_stride(m_bo)) { - if (m_bufferInterface) { - m_bufferInterface->ref(); - connect(m_bufferInterface, &KWaylandServer::BufferInterface::aboutToBeDestroyed, this, &GbmBuffer::clearBufferInterface); + if (m_clientBuffer) { + m_clientBuffer->ref(); } } @@ -53,8 +52,9 @@ GbmBuffer::~GbmBuffer() void GbmBuffer::releaseBuffer() { - if (m_bufferInterface) { - clearBufferInterface(); + if (m_clientBuffer) { + m_clientBuffer->unref(); + m_clientBuffer = nullptr; } if (!m_bo) { return; @@ -83,12 +83,6 @@ bool GbmBuffer::map(uint32_t flags) return m_data; } -void GbmBuffer::clearBufferInterface() -{ - disconnect(m_bufferInterface, &KWaylandServer::BufferInterface::aboutToBeDestroyed, this, &DrmGbmBuffer::clearBufferInterface); - m_bufferInterface->unref(); - m_bufferInterface = nullptr; -} DrmGbmBuffer::DrmGbmBuffer(DrmGpu *gpu, GbmSurface *surface, gbm_bo *bo) : DrmBuffer(gpu), GbmBuffer(surface, bo) @@ -96,8 +90,8 @@ DrmGbmBuffer::DrmGbmBuffer(DrmGpu *gpu, GbmSurface *surface, gbm_bo *bo) initialize(); } -DrmGbmBuffer::DrmGbmBuffer(DrmGpu *gpu, gbm_bo *buffer, KWaylandServer::BufferInterface *bufferInterface) - : DrmBuffer(gpu), GbmBuffer(buffer, bufferInterface) +DrmGbmBuffer::DrmGbmBuffer(DrmGpu *gpu, gbm_bo *buffer, KWaylandServer::ClientBuffer *clientBuffer) + : DrmBuffer(gpu), GbmBuffer(buffer, clientBuffer) { initialize(); } diff --git a/src/plugins/platforms/drm/drm_buffer_gbm.h b/src/plugins/platforms/drm/drm_buffer_gbm.h index 23425a1d32..d90efaf836 100644 --- a/src/plugins/platforms/drm/drm_buffer_gbm.h +++ b/src/plugins/platforms/drm/drm_buffer_gbm.h @@ -18,7 +18,7 @@ struct gbm_bo; namespace KWaylandServer { -class BufferInterface; +class ClientBuffer; } namespace KWin @@ -31,7 +31,7 @@ class GbmBuffer : public QObject Q_OBJECT public: GbmBuffer(GbmSurface *surface, gbm_bo *bo); - GbmBuffer(gbm_bo *buffer, KWaylandServer::BufferInterface *bufferInterface); + GbmBuffer(gbm_bo *buffer, KWaylandServer::ClientBuffer *clientBuffer); virtual ~GbmBuffer(); gbm_bo* getBo() const { @@ -51,20 +51,18 @@ public: protected: GbmSurface *m_surface = nullptr; gbm_bo *m_bo = nullptr; - KWaylandServer::BufferInterface *m_bufferInterface = nullptr; + KWaylandServer::ClientBuffer *m_clientBuffer = nullptr; void *m_data = nullptr; void *m_mapping = nullptr; uint32_t m_stride = 0; - - void clearBufferInterface(); }; class DrmGbmBuffer : public DrmBuffer, public GbmBuffer { public: DrmGbmBuffer(DrmGpu *gpu, GbmSurface *surface, gbm_bo *bo); - DrmGbmBuffer(DrmGpu *gpu, gbm_bo *buffer, KWaylandServer::BufferInterface *bufferInterface); + DrmGbmBuffer(DrmGpu *gpu, gbm_bo *buffer, KWaylandServer::ClientBuffer *clientBuffer); ~DrmGbmBuffer() override; bool needsModeChange(DrmBuffer *b) const override { diff --git a/src/plugins/platforms/drm/egl_gbm_backend.cpp b/src/plugins/platforms/drm/egl_gbm_backend.cpp index c9e8fc6b13..e22bdbdeb7 100644 --- a/src/plugins/platforms/drm/egl_gbm_backend.cpp +++ b/src/plugins/platforms/drm/egl_gbm_backend.cpp @@ -33,12 +33,10 @@ #include #include #include -#include #include // kwayland server #include "KWaylandServer/surface_interface.h" -#include "KWaylandServer/buffer_interface.h" -#include "KWaylandServer/linuxdmabuf_v1_interface.h" +#include "KWaylandServer/linuxdmabufv1clientbuffer.h" #include "KWaylandServer/clientconnection.h" namespace KWin @@ -598,47 +596,50 @@ bool EglGbmBackend::scanout(int screenId, SurfaceItem *surfaceItem) } KWaylandServer::SurfaceInterface *surface = item->surface(); - if (!surface || !surface->buffer() || !surface->buffer()->linuxDmabufBuffer()) { + if (!surface) { + return false; + } + + auto buffer = qobject_cast(surface->buffer()); + if (!buffer) { return false; } - auto buffer = surface->buffer(); Output &output = m_outputs[screenId]; - if (buffer->linuxDmabufBuffer()->size() != output.output->modeSize()) { + if (buffer->size() != output.output->modeSize()) { return false; } - EglDmabufBuffer *dmabuf = static_cast(buffer->linuxDmabufBuffer()); - if (!dmabuf || !dmabuf->planes().count() || - !gbm_device_is_format_supported(m_gpu->gbmDevice(), dmabuf->format(), GBM_BO_USE_SCANOUT)) { + if (!buffer->planes().count() || + !gbm_device_is_format_supported(m_gpu->gbmDevice(), buffer->format(), GBM_BO_USE_SCANOUT)) { return false; } gbm_bo *importedBuffer; - if (dmabuf->planes()[0].modifier != DRM_FORMAT_MOD_INVALID - || dmabuf->planes()[0].offset > 0 - || dmabuf->planes().size() > 1) { + if (buffer->planes()[0].modifier != DRM_FORMAT_MOD_INVALID + || buffer->planes()[0].offset > 0 + || buffer->planes().size() > 1) { if (!m_gpu->addFB2ModifiersSupported()) { return false; } gbm_import_fd_modifier_data data = {}; - data.format = dmabuf->format(); - data.width = (uint32_t) dmabuf->size().width(); - data.height = (uint32_t) dmabuf->size().height(); - data.num_fds = dmabuf->planes().count(); - data.modifier = dmabuf->planes()[0].modifier; - for (int i = 0; i < dmabuf->planes().count(); i++) { - auto plane = dmabuf->planes()[i]; + data.format = buffer->format(); + data.width = (uint32_t) buffer->size().width(); + data.height = (uint32_t) buffer->size().height(); + data.num_fds = buffer->planes().count(); + data.modifier = buffer->planes()[0].modifier; + for (int i = 0; i < buffer->planes().count(); i++) { + auto plane = buffer->planes()[i]; data.fds[i] = plane.fd; data.offsets[i] = plane.offset; data.strides[i] = plane.stride; } importedBuffer = gbm_bo_import(m_gpu->gbmDevice(), GBM_BO_IMPORT_FD_MODIFIER, &data, GBM_BO_USE_SCANOUT); } else { - auto plane = dmabuf->planes()[0]; + auto plane = buffer->planes()[0]; gbm_import_fd_data data = {}; data.fd = plane.fd; - data.width = (uint32_t) dmabuf->size().width(); - data.height = (uint32_t) dmabuf->size().height(); + data.width = (uint32_t) buffer->size().width(); + data.height = (uint32_t) buffer->size().height(); data.stride = plane.stride; - data.format = dmabuf->format(); + data.format = buffer->format(); importedBuffer = gbm_bo_import(m_gpu->gbmDevice(), GBM_BO_IMPORT_FD, &data, GBM_BO_USE_SCANOUT); } if (!importedBuffer) { diff --git a/src/plugins/platforms/drm/egl_gbm_backend.h b/src/plugins/platforms/drm/egl_gbm_backend.h index 1b9eca27fa..9d705f75c2 100644 --- a/src/plugins/platforms/drm/egl_gbm_backend.h +++ b/src/plugins/platforms/drm/egl_gbm_backend.h @@ -19,7 +19,6 @@ struct gbm_bo; namespace KWaylandServer { -class BufferInterface; class SurfaceInterface; } diff --git a/src/plugins/platforms/drm/egl_stream_backend.cpp b/src/plugins/platforms/drm/egl_stream_backend.cpp index 1ccf09dd17..62f73fce65 100644 --- a/src/plugins/platforms/drm/egl_stream_backend.cpp +++ b/src/plugins/platforms/drm/egl_stream_backend.cpp @@ -29,7 +29,7 @@ #include "drm_pipeline.h" #include -#include +#include #include #include #include @@ -664,7 +664,7 @@ void EglStreamSurfaceTextureWayland::copyExternalTexture(GLuint tex) glViewport(oldViewport[0], oldViewport[1], oldViewport[2], oldViewport[3]); } -bool EglStreamSurfaceTextureWayland::attachBuffer(KWaylandServer::BufferInterface *buffer) +bool EglStreamSurfaceTextureWayland::attachBuffer(KWaylandServer::ClientBuffer *buffer) { GLenum oldFormat = m_format; m_format = buffer->hasAlphaChannel() ? GL_RGBA : GL_RGB; @@ -679,7 +679,7 @@ bool EglStreamSurfaceTextureWayland::attachBuffer(KWaylandServer::BufferInterfac } bool EglStreamSurfaceTextureWayland::checkBuffer(KWaylandServer::SurfaceInterface *surface, - KWaylandServer::BufferInterface *buffer) + KWaylandServer::ClientBuffer *buffer) { EGLAttrib attribs[] = { EGL_WAYLAND_EGLSTREAM_WL, (EGLAttrib)buffer->resource(), diff --git a/src/plugins/platforms/drm/egl_stream_backend.h b/src/plugins/platforms/drm/egl_stream_backend.h index 6ef4472d0f..a01b9c7ce3 100644 --- a/src/plugins/platforms/drm/egl_stream_backend.h +++ b/src/plugins/platforms/drm/egl_stream_backend.h @@ -98,9 +98,9 @@ private: bool acquireStreamFrame(EGLStreamKHR stream); void createFbo(); void copyExternalTexture(GLuint tex); - bool attachBuffer(KWaylandServer::BufferInterface *buffer); + bool attachBuffer(KWaylandServer::ClientBuffer *buffer); bool checkBuffer(KWaylandServer::SurfaceInterface *surface, - KWaylandServer::BufferInterface *buffer); + KWaylandServer::ClientBuffer *buffer); EglStreamBackend *m_backend; GLuint m_fbo, m_rbo, m_textureId; diff --git a/src/plugins/platforms/wayland/egl_wayland_backend.cpp b/src/plugins/platforms/wayland/egl_wayland_backend.cpp index d971ae3d68..16ba52963a 100644 --- a/src/plugins/platforms/wayland/egl_wayland_backend.cpp +++ b/src/plugins/platforms/wayland/egl_wayland_backend.cpp @@ -31,7 +31,6 @@ // KDE #include -#include #include // Qt diff --git a/src/pointer_input.cpp b/src/pointer_input.cpp index b0246fb45e..38ca4ab953 100644 --- a/src/pointer_input.cpp +++ b/src/pointer_input.cpp @@ -22,7 +22,7 @@ // KDecoration #include // KWayland -#include +#include #include #include #include @@ -1115,7 +1115,7 @@ void CursorImage::updateServerCursor() } return; } - auto buffer = cursorSurface->buffer(); + auto buffer = qobject_cast(cursorSurface->buffer()); if (!buffer) { if (needsEmit) { Q_EMIT changed(); @@ -1184,7 +1184,7 @@ void CursorImage::updateDragCursor() QImage additionalIcon; if (auto ddi = waylandServer()->seat()->dragSource()) { if (const KWaylandServer::DragAndDropIcon *dragIcon = ddi->icon()) { - if (KWaylandServer::BufferInterface *buffer = dragIcon->surface()->buffer()) { + if (auto buffer = qobject_cast(dragIcon->surface()->buffer())) { additionalIcon = buffer->data().copy(); additionalIcon.setDevicePixelRatio(dragIcon->surface()->bufferScale()); additionalIcon.setOffset(dragIcon->position()); @@ -1212,7 +1212,7 @@ void CursorImage::updateDragCursor() } return; } - auto buffer = cursorSurface->buffer(); + auto buffer = qobject_cast(cursorSurface->buffer()); if (!buffer) { if (needsEmit) { Q_EMIT changed(); diff --git a/src/shadow.cpp b/src/shadow.cpp index a7496eef5f..8d3c69666e 100644 --- a/src/shadow.cpp +++ b/src/shadow.cpp @@ -20,7 +20,7 @@ #include #include -#include +#include #include #include @@ -214,20 +214,29 @@ bool Shadow::init(KDecoration2::Decoration *decoration) return true; } +static QPixmap shadowTileForBuffer(KWaylandServer::ClientBuffer *buffer) +{ + auto shmBuffer = qobject_cast(buffer); + if (shmBuffer) { + return QPixmap::fromImage(shmBuffer->data().copy()); + } + return QPixmap(); +} + bool Shadow::init(const QPointer< KWaylandServer::ShadowInterface > &shadow) { if (!shadow) { return false; } - m_shadowElements[ShadowElementTop] = shadow->top() ? QPixmap::fromImage(shadow->top()->data().copy()) : QPixmap(); - m_shadowElements[ShadowElementTopRight] = shadow->topRight() ? QPixmap::fromImage(shadow->topRight()->data().copy()) : QPixmap(); - m_shadowElements[ShadowElementRight] = shadow->right() ? QPixmap::fromImage(shadow->right()->data().copy()) : QPixmap(); - m_shadowElements[ShadowElementBottomRight] = shadow->bottomRight() ? QPixmap::fromImage(shadow->bottomRight()->data().copy()) : QPixmap(); - m_shadowElements[ShadowElementBottom] = shadow->bottom() ? QPixmap::fromImage(shadow->bottom()->data().copy()) : QPixmap(); - m_shadowElements[ShadowElementBottomLeft] = shadow->bottomLeft() ? QPixmap::fromImage(shadow->bottomLeft()->data().copy()) : QPixmap(); - m_shadowElements[ShadowElementLeft] = shadow->left() ? QPixmap::fromImage(shadow->left()->data().copy()) : QPixmap(); - m_shadowElements[ShadowElementTopLeft] = shadow->topLeft() ? QPixmap::fromImage(shadow->topLeft()->data().copy()) : QPixmap(); + m_shadowElements[ShadowElementTop] = shadowTileForBuffer(shadow->top()); + m_shadowElements[ShadowElementTopRight] = shadowTileForBuffer(shadow->topRight()); + m_shadowElements[ShadowElementRight] = shadowTileForBuffer(shadow->right()); + m_shadowElements[ShadowElementBottomRight] = shadowTileForBuffer(shadow->bottomRight()); + m_shadowElements[ShadowElementBottom] = shadowTileForBuffer(shadow->bottom()); + m_shadowElements[ShadowElementBottomLeft] = shadowTileForBuffer(shadow->bottomLeft()); + m_shadowElements[ShadowElementLeft] = shadowTileForBuffer(shadow->left()); + m_shadowElements[ShadowElementTopLeft] = shadowTileForBuffer(shadow->topLeft()); m_offset = shadow->offset().toMargins(); Q_EMIT offsetChanged(); diff --git a/src/surfaceitem_wayland.cpp b/src/surfaceitem_wayland.cpp index 45e850a20d..1eed81623e 100644 --- a/src/surfaceitem_wayland.cpp +++ b/src/surfaceitem_wayland.cpp @@ -8,7 +8,7 @@ #include "composite.h" #include "scene.h" -#include +#include #include #include @@ -111,7 +111,7 @@ void SurfaceItemWayland::handleChildSubSurfacesChanged() SurfaceItemWayland *subsurfaceItem = getOrCreateSubSurfaceItem(below[i]); subsurfaceItem->setZ(i - below.count()); } - + for (int i = 0; i < above.count(); ++i) { SurfaceItemWayland *subsurfaceItem = getOrCreateSubSurfaceItem(above[i]); subsurfaceItem->setZ(i); @@ -149,7 +149,7 @@ KWaylandServer::SurfaceInterface *SurfacePixmapWayland::surface() const return m_item->surface(); } -KWaylandServer::BufferInterface *SurfacePixmapWayland::buffer() const +KWaylandServer::ClientBuffer *SurfacePixmapWayland::buffer() const { return m_buffer; } @@ -169,31 +169,20 @@ void SurfacePixmapWayland::update() bool SurfacePixmapWayland::isValid() const { - // Referenced buffers get destroyed under our nose, check also the platform texture - // to work around BufferInterface's weird api. - return m_buffer || platformTexture()->isValid(); + return m_buffer; } -void SurfacePixmapWayland::clearBuffer() -{ - setBuffer(nullptr); -} - -void SurfacePixmapWayland::setBuffer(KWaylandServer::BufferInterface *buffer) +void SurfacePixmapWayland::setBuffer(KWaylandServer::ClientBuffer *buffer) { if (m_buffer == buffer) { return; } if (m_buffer) { - disconnect(m_buffer, &KWaylandServer::BufferInterface::aboutToBeDestroyed, - this, &SurfacePixmapWayland::clearBuffer); m_buffer->unref(); } m_buffer = buffer; if (m_buffer) { m_buffer->ref(); - connect(m_buffer, &KWaylandServer::BufferInterface::aboutToBeDestroyed, - this, &SurfacePixmapWayland::clearBuffer); m_hasAlphaChannel = m_buffer->hasAlphaChannel(); } } diff --git a/src/surfaceitem_wayland.h b/src/surfaceitem_wayland.h index 07739966d4..c53a8c15ca 100644 --- a/src/surfaceitem_wayland.h +++ b/src/surfaceitem_wayland.h @@ -10,7 +10,7 @@ namespace KWaylandServer { -class BufferInterface; +class ClientBuffer; class SubSurfaceInterface; class SurfaceInterface; } @@ -63,18 +63,17 @@ public: SurfaceItemWayland *item() const; KWaylandServer::SurfaceInterface *surface() const; - KWaylandServer::BufferInterface *buffer() const; + KWaylandServer::ClientBuffer *buffer() const; void create() override; void update() override; bool isValid() const override; private: - void clearBuffer(); - void setBuffer(KWaylandServer::BufferInterface *buffer); + void setBuffer(KWaylandServer::ClientBuffer *buffer); SurfaceItemWayland *m_item; - KWaylandServer::BufferInterface *m_buffer = nullptr; + KWaylandServer::ClientBuffer *m_buffer = nullptr; }; /** diff --git a/src/wayland_server.cpp b/src/wayland_server.cpp index 937e598bc0..dac6f60271 100644 --- a/src/wayland_server.cpp +++ b/src/wayland_server.cpp @@ -42,7 +42,7 @@ #include #include #include -#include +#include #include #include #include @@ -537,11 +537,10 @@ bool WaylandServer::init(InitializationFlags flags) return true; } -KWaylandServer::LinuxDmabufUnstableV1Interface *WaylandServer::linuxDmabuf() +KWaylandServer::LinuxDmaBufV1ClientBufferIntegration *WaylandServer::linuxDmabuf() { if (!m_linuxDmabuf) { - m_linuxDmabuf = new LinuxDmabufUnstableV1Interface(m_display, m_display); - m_linuxDmabuf->create(); + m_linuxDmabuf = new LinuxDmaBufV1ClientBufferIntegration(m_display); } return m_linuxDmabuf; } diff --git a/src/wayland_server.h b/src/wayland_server.h index 8d30f38a69..25c6aa2bdb 100644 --- a/src/wayland_server.h +++ b/src/wayland_server.h @@ -54,8 +54,8 @@ class OutputConfigurationInterface; class XdgForeignV2Interface; class XdgOutputManagerV1Interface; class KeyStateInterface; -class LinuxDmabufUnstableV1Interface; -class LinuxDmabufUnstableV1Buffer; +class LinuxDmaBufV1ClientBufferIntegration; +class LinuxDmaBufV1ClientBuffer; class TabletManagerV2Interface; class KeyboardShortcutsInhibitManagerV1Interface; class XdgDecorationManagerV1Interface; @@ -137,7 +137,7 @@ public: bool isKeyboardShortcutsInhibited() const; - KWaylandServer::LinuxDmabufUnstableV1Interface *linuxDmabuf(); + KWaylandServer::LinuxDmaBufV1ClientBufferIntegration *linuxDmabuf(); KWaylandServer::InputMethodV1Interface *inputMethod() const { return m_inputMethod; @@ -235,13 +235,13 @@ public: void simulateUserActivity(); void updateKeyState(KWin::Xkb::LEDs leds); - QSet linuxDmabufBuffers() const { + QSet linuxDmabufBuffers() const { return m_linuxDmabufBuffers; } - void addLinuxDmabufBuffer(KWaylandServer::LinuxDmabufUnstableV1Buffer *buffer) { + void addLinuxDmabufBuffer(KWaylandServer::LinuxDmaBufV1ClientBuffer *buffer) { m_linuxDmabufBuffers << buffer; } - void removeLinuxDmabufBuffer(KWaylandServer::LinuxDmabufUnstableV1Buffer *buffer) { + void removeLinuxDmabufBuffer(KWaylandServer::LinuxDmaBufV1ClientBuffer *buffer) { m_linuxDmabufBuffers.remove(buffer); } @@ -288,9 +288,9 @@ private: KWaylandServer::IdleInterface *m_idle = nullptr; KWaylandServer::XdgOutputManagerV1Interface *m_xdgOutputManagerV1 = nullptr; KWaylandServer::XdgDecorationManagerV1Interface *m_xdgDecorationManagerV1 = nullptr; - KWaylandServer::LinuxDmabufUnstableV1Interface *m_linuxDmabuf = nullptr; + KWaylandServer::LinuxDmaBufV1ClientBufferIntegration *m_linuxDmabuf = nullptr; KWaylandServer::KeyboardShortcutsInhibitManagerV1Interface *m_keyboardShortcutsInhibitManager = nullptr; - QSet m_linuxDmabufBuffers; + QSet m_linuxDmabufBuffers; QPointer m_xwaylandConnection; KWaylandServer::InputMethodV1Interface *m_inputMethod = nullptr; KWaylandServer::ClientConnection *m_inputMethodServerConnection = nullptr; diff --git a/src/waylandclient.cpp b/src/waylandclient.cpp index 17af20be05..c939bc51a1 100644 --- a/src/waylandclient.cpp +++ b/src/waylandclient.cpp @@ -12,9 +12,9 @@ #include "workspace.h" #include +#include #include #include -#include #include diff --git a/src/xdgshellclient.cpp b/src/xdgshellclient.cpp index fd92bd6872..a2e04251b3 100644 --- a/src/xdgshellclient.cpp +++ b/src/xdgshellclient.cpp @@ -26,7 +26,6 @@ #include #include #include -#include #include #include #include