rules: add layer and window xray rules

This commit is contained in:
vaxerski 2023-08-09 22:03:24 +02:00
parent fe9453c643
commit cbb899740c
8 changed files with 65 additions and 11 deletions

View file

@ -12,6 +12,7 @@ void SLayerSurface::applyRules() {
forceBlur = false;
ignoreAlpha = false;
ignoreAlphaValue = 0.f;
xray = -1;
for (auto& rule : g_pConfigManager->getMatchingRules(this)) {
if (rule.rule == "noanim")
@ -29,6 +30,11 @@ void SLayerSurface::applyRules() {
if (!alphaValue.empty())
ignoreAlphaValue = std::stof(alphaValue);
} catch (...) { Debug::log(ERR, "Invalid value passed to ignoreAlpha"); }
} else if (rule.rule.find("xray") == 0) {
CVarList vars{rule.rule, 0, ' '};
try {
xray = configStringToInt(vars[1]);
} catch (...) {}
}
}
}

View file

@ -50,6 +50,7 @@ struct SLayerSurface {
bool noAnimations = false;
bool forceBlur = false;
int xray = -1;
bool ignoreAlpha = false;
float ignoreAlphaValue = 0.f;
@ -242,7 +243,7 @@ struct STablet {
std::string name = "";
bool operator==(const STablet& b) const {
return wlrDevice == b.wlrDevice;
return wlrDevice == b.wlrDevice;
}
};