From 4b751ccb0d431fc8fcdeba81ee09ddaf98ff848d Mon Sep 17 00:00:00 2001 From: outfoxxed Date: Thu, 2 Apr 2026 21:56:52 -0700 Subject: [PATCH] wayland/screencopy: use linear texture filtering over nearest Fixes pixelated views at scaled resolutions. --- changelog/next.md | 1 + src/wayland/buffer/manager.cpp | 4 ++++ src/wayland/buffer/qsg.hpp | 1 + src/wayland/screencopy/view.cpp | 1 + 4 files changed, 7 insertions(+) diff --git a/changelog/next.md b/changelog/next.md index 024ab10..17b8cd4 100644 --- a/changelog/next.md +++ b/changelog/next.md @@ -64,6 +64,7 @@ set shell id. - Fixed partial socket reads in greetd and hyprland on slow machines. - Worked around Qt bug causing crashes when plugging and unplugging monitors. - Fixed HyprlandFocusGrab crashing if windows were destroyed after being passed to it. +- Fixed ScreencopyView pixelation when scaled. ## Packaging Changes diff --git a/src/wayland/buffer/manager.cpp b/src/wayland/buffer/manager.cpp index 713752a..9cf77fd 100644 --- a/src/wayland/buffer/manager.cpp +++ b/src/wayland/buffer/manager.cpp @@ -123,6 +123,10 @@ void WlBufferQSGDisplayNode::setRect(const QRectF& rect) { this->setMatrix(matrix); } +void WlBufferQSGDisplayNode::setFiltering(QSGTexture::Filtering filtering) { + this->imageNode->setFiltering(filtering); +} + void WlBufferQSGDisplayNode::syncSwapchain(const WlBufferSwapchain& swapchain) { auto* buffer = swapchain.frontbuffer(); auto& texture = swapchain.presentSecondBuffer ? this->buffer2 : this->buffer1; diff --git a/src/wayland/buffer/qsg.hpp b/src/wayland/buffer/qsg.hpp index c230cfe..bb05954 100644 --- a/src/wayland/buffer/qsg.hpp +++ b/src/wayland/buffer/qsg.hpp @@ -33,6 +33,7 @@ public: void syncSwapchain(const WlBufferSwapchain& swapchain); void setRect(const QRectF& rect); + void setFiltering(QSGTexture::Filtering filtering); private: QQuickWindow* window; diff --git a/src/wayland/screencopy/view.cpp b/src/wayland/screencopy/view.cpp index 7828c98..7d10dc2 100644 --- a/src/wayland/screencopy/view.cpp +++ b/src/wayland/screencopy/view.cpp @@ -167,6 +167,7 @@ QSGNode* ScreencopyView::updatePaintNode(QSGNode* oldNode, UpdatePaintNodeData* auto& swapchain = this->context->swapchain(); node->syncSwapchain(swapchain); node->setRect(this->boundingRect()); + node->setFiltering(QSGTexture::Linear); // NOLINT (misc-include-cleaner) if (this->mLive) this->context->captureFrame(); return node;