diff options
| author | vaxerski <43317083+vaxerski@users.noreply.github.com> | 2023-03-17 23:16:13 +0000 |
|---|---|---|
| committer | vaxerski <43317083+vaxerski@users.noreply.github.com> | 2023-03-17 23:16:13 +0000 |
| commit | e5870d47c74150aa744ed55f9b7e58713d968209 (patch) | |
| tree | 227fda73f787873bc97b64be333d0e0f7d596ec7 /src/helpers | |
| parent | 91a565c7b0957968d686fccf8f3a5166b9c3fec9 (diff) | |
LS: add blur and ignorezero rules
Diffstat (limited to 'src/helpers')
| -rw-r--r-- | src/helpers/WLClasses.cpp | 15 | ||||
| -rw-r--r-- | src/helpers/WLClasses.hpp | 5 |
2 files changed, 19 insertions, 1 deletions
diff --git a/src/helpers/WLClasses.cpp b/src/helpers/WLClasses.cpp index 9b6926e2..29e10a54 100644 --- a/src/helpers/WLClasses.cpp +++ b/src/helpers/WLClasses.cpp @@ -5,4 +5,19 @@ SLayerSurface::SLayerSurface() { alpha.create(AVARTYPE_FLOAT, g_pConfigManager->getAnimationPropertyConfig("fadeIn"), nullptr, AVARDAMAGE_ENTIRE); alpha.m_pLayer = this; alpha.registerVar(); +} + +void SLayerSurface::applyRules() { + noAnimations = false; + forceBlur = false; + ignoreZero = false; + + for (auto& rule : g_pConfigManager->getMatchingRules(this)) { + if (rule.rule == "noanim") + noAnimations = true; + else if (rule.rule == "blur") + forceBlur = true; + else if (rule.rule == "ignorezero") + ignoreZero = true; + } }
\ No newline at end of file diff --git a/src/helpers/WLClasses.hpp b/src/helpers/WLClasses.hpp index 55524ad1..7b87f3d1 100644 --- a/src/helpers/WLClasses.hpp +++ b/src/helpers/WLClasses.hpp @@ -15,6 +15,8 @@ struct SLayerRule { struct SLayerSurface { SLayerSurface(); + void applyRules(); + wlr_layer_surface_v1* layerSurface; wl_list link; @@ -40,7 +42,8 @@ struct SLayerSurface { bool noProcess = false; bool noAnimations = false; - bool forceBlur = false; + bool forceBlur = false; + bool ignoreZero = false; // For the list lookup bool operator==(const SLayerSurface& rhs) const { |
