summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorVaxry <43317083+vaxerski@users.noreply.github.com>2025-10-15 14:08:34 +0200
committerGitHub <noreply@github.com>2025-10-15 14:08:34 +0200
commite40873be51c2e2cac2f2631105ac0b0b19603b4f (patch)
treec77b712fc86df0aac72a62fda583d4035ad79776 /src
parent60529e810d100231d17abab438f94460d4b9fc7e (diff)
renderer: add cursor:zoom_disable_aa for controlling AA on zoom (#12025)
Diffstat (limited to 'src')
-rw-r--r--src/config/ConfigDescriptions.hpp6
-rw-r--r--src/config/ConfigManager.cpp1
-rw-r--r--src/render/OpenGL.cpp5
3 files changed, 10 insertions, 2 deletions
diff --git a/src/config/ConfigDescriptions.hpp b/src/config/ConfigDescriptions.hpp
index 1352667f..60a21c8b 100644
--- a/src/config/ConfigDescriptions.hpp
+++ b/src/config/ConfigDescriptions.hpp
@@ -1628,6 +1628,12 @@ inline static const std::vector<SConfigOptionDescription> CONFIG_OPTIONS = {
.data = SConfigOptionDescription::SBoolData{false},
},
SConfigOptionDescription{
+ .value = "cursor:zoom_disable_aa",
+ .description = "If enabled, when zooming, no antialiasing will be used (zoom will be pixelated)",
+ .type = CONFIG_OPTION_BOOL,
+ .data = SConfigOptionDescription::SBoolData{false},
+ },
+ SConfigOptionDescription{
.value = "cursor:enable_hyprcursor",
.description = "whether to enable hyprcursor support",
.type = CONFIG_OPTION_BOOL,
diff --git a/src/config/ConfigManager.cpp b/src/config/ConfigManager.cpp
index 7b24263a..f736eaf0 100644
--- a/src/config/ConfigManager.cpp
+++ b/src/config/ConfigManager.cpp
@@ -751,6 +751,7 @@ CConfigManager::CConfigManager() {
registerConfigVar("cursor:default_monitor", {STRVAL_EMPTY});
registerConfigVar("cursor:zoom_factor", {1.f});
registerConfigVar("cursor:zoom_rigid", Hyprlang::INT{0});
+ registerConfigVar("cursor:zoom_disable_aa", Hyprlang::INT{0});
registerConfigVar("cursor:enable_hyprcursor", Hyprlang::INT{1});
registerConfigVar("cursor:sync_gsettings_theme", Hyprlang::INT{1});
registerConfigVar("cursor:hide_on_key_press", Hyprlang::INT{0});
diff --git a/src/render/OpenGL.cpp b/src/render/OpenGL.cpp
index 1fd44392..3c30c4a1 100644
--- a/src/render/OpenGL.cpp
+++ b/src/render/OpenGL.cpp
@@ -799,7 +799,8 @@ void CHyprOpenGLImpl::begin(PHLMONITOR pMonitor, const CRegion& damage_, CFrameb
}
void CHyprOpenGLImpl::end() {
- static auto PZOOMRIGID = CConfigValue<Hyprlang::INT>("cursor:zoom_rigid");
+ static auto PZOOMRIGID = CConfigValue<Hyprlang::INT>("cursor:zoom_rigid");
+ static auto PZOOMDISABLEAA = CConfigValue<Hyprlang::INT>("cursor:zoom_disable_aa");
TRACY_GPU_ZONE("RenderEnd");
@@ -826,7 +827,7 @@ void CHyprOpenGLImpl::end() {
}
m_applyFinalShader = !m_renderData.blockScreenShader;
- if (m_renderData.mouseZoomUseMouse)
+ if (m_renderData.mouseZoomUseMouse && *PZOOMDISABLEAA)
m_renderData.useNearestNeighbor = true;
// copy the damaged areas into the mirror buffer