summaryrefslogtreecommitdiff
path: root/src/protocols/CTMControl.cpp
diff options
context:
space:
mode:
authorvaxerski <vaxry@vaxry.net>2024-12-30 11:57:55 +0100
committervaxerski <vaxry@vaxry.net>2024-12-30 11:58:35 +0100
commit8c14c2a5f472cf3d361d3cbb90ee7d2d455aae08 (patch)
tree7c464daa3c804f9da644fb1a162c7301236d5bb2 /src/protocols/CTMControl.cpp
parentcb211d83f68542e9fbf7567d57bdf528286cbf7e (diff)
ctm: disable fade animation by default on nvidia
Fixes #8891, the nvidia driver dies when we spam CTM too much.
Diffstat (limited to 'src/protocols/CTMControl.cpp')
-rw-r--r--src/protocols/CTMControl.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/protocols/CTMControl.cpp b/src/protocols/CTMControl.cpp
index 42c84e8f..250c6326 100644
--- a/src/protocols/CTMControl.cpp
+++ b/src/protocols/CTMControl.cpp
@@ -1,6 +1,8 @@
#include "CTMControl.hpp"
#include "../Compositor.hpp"
+#include "../render/Renderer.hpp"
#include "core/Output.hpp"
+#include "../config/ConfigValue.hpp"
CHyprlandCTMControlResource::CHyprlandCTMControlResource(SP<CHyprlandCtmControlManagerV1> resource_) : resource(resource_) {
if (!good())
@@ -81,12 +83,24 @@ void CHyprlandCTMControlProtocol::destroyResource(CHyprlandCTMControlResource* r
std::erase_if(m_vManagers, [&](const auto& other) { return other.get() == res; });
}
+bool CHyprlandCTMControlProtocol::isCTMAnimationEnabled() {
+ static auto PENABLEANIM = CConfigValue<Hyprlang::INT>("render:ctm_animation");
+
+ if (*PENABLEANIM == 2)
+ return !g_pHyprRenderer->isNvidia();
+ return *PENABLEANIM;
+}
+
CHyprlandCTMControlProtocol::SCTMData::SCTMData() {
progress.create(g_pConfigManager->getAnimationPropertyConfig("__internal_fadeCTM"), AVARDAMAGE_NONE);
progress.setValueAndWarp(0.F);
}
void CHyprlandCTMControlProtocol::setCTM(PHLMONITOR monitor, const Mat3x3& ctm) {
+ if (!isCTMAnimationEnabled()) {
+ monitor->setCTM(ctm);
+ return;
+ }
std::erase_if(m_mCTMDatas, [](const auto& el) { return !el.first; });