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
This commit is contained in:
parent
02f7da2bf2
commit
51afc2c291
4 changed files with 45 additions and 37 deletions
|
|
@ -6,6 +6,7 @@
|
|||
#include "../config/ConfigManager.hpp"
|
||||
#include "managers/AnimationManager.hpp"
|
||||
#include "../helpers/Monitor.hpp"
|
||||
#include "../helpers/MiscFunctions.hpp"
|
||||
|
||||
CHyprlandCTMControlResource::CHyprlandCTMControlResource(SP<CHyprlandCtmControlManagerV1> resource_) : resource(resource_) {
|
||||
if UNLIKELY (!good())
|
||||
|
|
@ -109,8 +110,12 @@ void CHyprlandCTMControlProtocol::destroyResource(CHyprlandCTMControlResource* r
|
|||
bool CHyprlandCTMControlProtocol::isCTMAnimationEnabled() {
|
||||
static auto PENABLEANIM = CConfigValue<Hyprlang::INT>("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;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue