renderer: allow blurring ls popups

This commit is contained in:
Vaxry 2024-03-25 16:08:55 +00:00
parent 356414639f
commit ca17a89d86
8 changed files with 85 additions and 22 deletions

View file

@ -37,6 +37,8 @@ void SLayerSurface::applyRules() {
noAnimations = true;
else if (rule.rule == "blur")
forceBlur = true;
else if (rule.rule == "blurpopups")
forceBlurPopups = true;
else if (rule.rule.starts_with("ignorealpha") || rule.rule.starts_with("ignorezero")) {
const auto FIRST_SPACE_POS = rule.rule.find_first_of(' ');
std::string alphaValue = "";
@ -168,6 +170,13 @@ bool SLayerSurface::isFadedOut() {
return !realPosition.isBeingAnimated() && !realSize.isBeingAnimated() && !alpha.isBeingAnimated();
}
int SLayerSurface::popupsCount() {
int no = 0;
wlr_layer_surface_v1_for_each_popup_surface(
layerSurface, [](wlr_surface* s, int x, int y, void* data) { *(int*)data += 1; }, &no);
return no;
}
void SKeyboard::updateXKBTranslationState(xkb_keymap* const keymap) {
xkb_state_unref(xkbTranslationState);

View file

@ -22,6 +22,7 @@ struct SLayerSurface {
void applyRules();
void startAnimation(bool in, bool instant = false);
bool isFadedOut();
int popupsCount();
CAnimatedVariable<Vector2D> realPosition;
CAnimatedVariable<Vector2D> realSize;
@ -58,6 +59,7 @@ struct SLayerSurface {
bool noAnimations = false;
bool forceBlur = false;
bool forceBlurPopups = false;
int xray = -1;
bool ignoreAlpha = false;
float ignoreAlphaValue = 0.f;