Update blurriness of layersurfaces after hyprctl keyword blurls (#1493)

* Update blurriness of layersurfaces after hyprctl keyword blurls
This commit is contained in:
eriedaberrie 2023-02-05 14:46:20 -08:00 committed by GitHub
parent 53945cff31
commit 15544c7544
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 15 additions and 1 deletions

View file

@ -923,14 +923,27 @@ void CConfigManager::handleWindowRuleV2(const std::string& command, const std::s
m_dWindowRules.push_back(rule); 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) { void CConfigManager::handleBlurLS(const std::string& command, const std::string& value) {
if (value.find("remove,") == 0) { if (value.find("remove,") == 0) {
const auto TOREMOVE = removeBeginEndSpacesTabs(value.substr(7)); 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; return;
} }
m_dBlurLSNamespaces.emplace_back(value); m_dBlurLSNamespaces.emplace_back(value);
updateBlurredLS(value, true);
} }
void CConfigManager::handleDefaultWorkspace(const std::string& command, const std::string& value) { void CConfigManager::handleDefaultWorkspace(const std::string& command, const std::string& value) {

View file

@ -214,6 +214,7 @@ class CConfigManager {
void setDeviceDefaultVars(const std::string&); void setDeviceDefaultVars(const std::string&);
void setAnimForChildren(SAnimationPropertyConfig* const); void setAnimForChildren(SAnimationPropertyConfig* const);
void updateBlurredLS(const std::string&, const bool);
void applyUserDefinedVars(std::string&, const size_t); void applyUserDefinedVars(std::string&, const size_t);
void loadConfigLoadVars(); void loadConfigLoadVars();