cursordelgate: round cursor position when rendering

Otherwise there can be weird artifacts when screen scaling is involved


(cherry picked from commit 3334fb8752bb1e5dd40d8fa9969c8ba24d2547b8)
icc-effect-5.27.2
Xaver Hugl 2023-02-20 16:22:24 +01:00
parent aa700a13d6
commit 699d7fdd88
1 changed files with 3 additions and 1 deletions

View File

@ -13,6 +13,8 @@
#include "kwinglutils.h"
#include "scene/cursorscene.h"
#include <cmath>
namespace KWin
{
@ -48,7 +50,7 @@ void CursorDelegateOpenGL::paint(RenderTarget *renderTarget, const QRegion &regi
QMatrix4x4 mvp;
mvp.ortho(QRect(QPoint(0, 0), renderTarget->size()));
mvp.translate(cursorRect.x() * scale, cursorRect.y() * scale);
mvp.translate(std::round(cursorRect.x() * scale), std::round(cursorRect.y() * scale));
GLFramebuffer *fbo = std::get<GLFramebuffer *>(renderTarget->nativeHandle());
GLFramebuffer::pushFramebuffer(fbo);