From 64ce06a3536898ddae7146e8f649361ce081c8d6 Mon Sep 17 00:00:00 2001 From: vaxerski Date: Sun, 11 Jun 2023 21:33:50 +0200 Subject: [PATCH] xwayland: add nearest neighbor filtering as an opt --- src/config/ConfigManager.cpp | 2 ++ src/render/Renderer.cpp | 6 ++++++ 2 files changed, 8 insertions(+) diff --git a/src/config/ConfigManager.cpp b/src/config/ConfigManager.cpp index e649e1ab3..e19a94d4d 100644 --- a/src/config/ConfigManager.cpp +++ b/src/config/ConfigManager.cpp @@ -206,6 +206,8 @@ void CConfigManager::setDefaultVars() { configValues["gestures:workspace_swipe_forever"].intValue = 0; configValues["gestures:workspace_swipe_numbered"].intValue = 0; + configValues["xwayland:use_nearest_neighbor"].intValue = 1; + configValues["autogenerated"].intValue = 0; } diff --git a/src/render/Renderer.cpp b/src/render/Renderer.cpp index 6d9958756..939b5783d 100644 --- a/src/render/Renderer.cpp +++ b/src/render/Renderer.cpp @@ -324,8 +324,14 @@ void CHyprRenderer::renderWindow(CWindow* pWindow, CMonitor* pMonitor, timespec* for (auto& wd : pWindow->m_dWindowDecorations) wd->draw(pMonitor, renderdata.alpha * renderdata.fadeAlpha, offset); + static auto* const PXWLUSENN = &g_pConfigManager->getConfigValuePtr("xwayland:use_nearest_neighbor")->intValue; + if (pWindow->m_bIsX11 && *PXWLUSENN) + g_pHyprOpenGL->m_RenderData.useNearestNeighbor = true; + wlr_surface_for_each_surface(pWindow->m_pWLSurface.wlr(), renderSurface, &renderdata); + g_pHyprOpenGL->m_RenderData.useNearestNeighbor = false; + if (renderdata.decorate && pWindow->m_sSpecialRenderData.border) { static auto* const PROUNDING = &g_pConfigManager->getConfigValuePtr("decoration:rounding")->intValue;