From 51afc2c2910d6f7c1f2dee9c90f54729d3c3d940 Mon Sep 17 00:00:00 2001 From: fazzi <18248986+fxzzi@users.noreply.github.com> Date: Fri, 18 Apr 2025 20:44:54 +0100 Subject: ctm: enable fade animation on nvidia driver versions 575 and above (#10095) * ctm: enable fade animation on nvidia driver versions 575 and above * format if statement without braces; handle potential throw when checking for nvidia version file --- src/protocols/CTMControl.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'src/protocols/CTMControl.cpp') diff --git a/src/protocols/CTMControl.cpp b/src/protocols/CTMControl.cpp index c3b6862d..7dbe635b 100644 --- a/src/protocols/CTMControl.cpp +++ b/src/protocols/CTMControl.cpp @@ -6,6 +6,7 @@ #include "../config/ConfigManager.hpp" #include "managers/AnimationManager.hpp" #include "../helpers/Monitor.hpp" +#include "../helpers/MiscFunctions.hpp" CHyprlandCTMControlResource::CHyprlandCTMControlResource(SP resource_) : resource(resource_) { if UNLIKELY (!good()) @@ -109,8 +110,12 @@ void CHyprlandCTMControlProtocol::destroyResource(CHyprlandCTMControlResource* r bool CHyprlandCTMControlProtocol::isCTMAnimationEnabled() { static auto PENABLEANIM = CConfigValue("render:ctm_animation"); - if (*PENABLEANIM == 2) - return !g_pHyprRenderer->isNvidia(); + if (*PENABLEANIM == 2 /* auto */) { + if (!g_pHyprRenderer->isNvidia()) + return true; + // CTM animations are bugged on versions below. + return isNvidiaDriverVersionAtLeast(575); + } return *PENABLEANIM; } -- cgit v1.2.3