diff options
author | eriedaberrie <[email protected]> | 2023-02-05 14:46:20 -0800 |
---|---|---|
committer | GitHub <[email protected]> | 2023-02-05 22:46:20 +0000 |
commit | 15544c7544ac80f90fa341081967b95b70a8e046 (patch) | |
tree | 2f29d1c5e8d0beb21353a7279df3c9cc95dac14e | |
parent | 53945cff3184cfdff3ed978e072b4ed65e3b2ec5 (diff) | |
download | Hyprland-15544c7544ac80f90fa341081967b95b70a8e046.tar.gz Hyprland-15544c7544ac80f90fa341081967b95b70a8e046.zip |
Update blurriness of layersurfaces after hyprctl keyword blurls (#1493)
* Update blurriness of layersurfaces after hyprctl keyword blurls
-rw-r--r-- | src/config/ConfigManager.cpp | 15 | ||||
-rw-r--r-- | src/config/ConfigManager.hpp | 1 |
2 files changed, 15 insertions, 1 deletions
diff --git a/src/config/ConfigManager.cpp b/src/config/ConfigManager.cpp index b8704467..8bc12fda 100644 --- a/src/config/ConfigManager.cpp +++ b/src/config/ConfigManager.cpp @@ -923,14 +923,27 @@ void CConfigManager::handleWindowRuleV2(const std::string& command, const std::s m_dWindowRules.push_back(rule); } +void CConfigManager::updateBlurredLS(const std::string& name, const bool forceBlur) { + for (auto& m : g_pCompositor->m_vMonitors) { + for (auto& lsl : m->m_aLayerSurfaceLayers) { + for (auto& ls : lsl) { + if (ls->szNamespace == name) + ls->forceBlur = forceBlur; + } + } + } +} + void CConfigManager::handleBlurLS(const std::string& command, const std::string& value) { if (value.find("remove,") == 0) { const auto TOREMOVE = removeBeginEndSpacesTabs(value.substr(7)); - std::erase_if(m_dBlurLSNamespaces, [&](const auto& other) { return other == TOREMOVE; }); + if (std::erase_if(m_dBlurLSNamespaces, [&](const auto& other) { return other == TOREMOVE; })) + updateBlurredLS(TOREMOVE, false); return; } m_dBlurLSNamespaces.emplace_back(value); + updateBlurredLS(value, true); } void CConfigManager::handleDefaultWorkspace(const std::string& command, const std::string& value) { diff --git a/src/config/ConfigManager.hpp b/src/config/ConfigManager.hpp index 80971966..e246d506 100644 --- a/src/config/ConfigManager.hpp +++ b/src/config/ConfigManager.hpp @@ -214,6 +214,7 @@ class CConfigManager { void setDeviceDefaultVars(const std::string&); void setAnimForChildren(SAnimationPropertyConfig* const); + void updateBlurredLS(const std::string&, const bool); void applyUserDefinedVars(std::string&, const size_t); void loadConfigLoadVars(); |