renderer: add decoration:blur:popups_ignorealpha

fixes #4282
This commit is contained in:
Vaxry 2023-12-28 22:28:58 +01:00
parent 5f65946c84
commit 4f3ee4c645
2 changed files with 43 additions and 34 deletions

View file

@ -159,37 +159,38 @@ void CConfigManager::setDefaultVars() {
configValues["debug:watchdog_timeout"].intValue = 5; configValues["debug:watchdog_timeout"].intValue = 5;
configValues["debug:disable_scale_checks"].intValue = 0; configValues["debug:disable_scale_checks"].intValue = 0;
configValues["decoration:rounding"].intValue = 0; configValues["decoration:rounding"].intValue = 0;
configValues["decoration:blur:enabled"].intValue = 1; configValues["decoration:blur:enabled"].intValue = 1;
configValues["decoration:blur:size"].intValue = 8; configValues["decoration:blur:size"].intValue = 8;
configValues["decoration:blur:passes"].intValue = 1; configValues["decoration:blur:passes"].intValue = 1;
configValues["decoration:blur:ignore_opacity"].intValue = 0; configValues["decoration:blur:ignore_opacity"].intValue = 0;
configValues["decoration:blur:new_optimizations"].intValue = 1; configValues["decoration:blur:new_optimizations"].intValue = 1;
configValues["decoration:blur:xray"].intValue = 0; configValues["decoration:blur:xray"].intValue = 0;
configValues["decoration:blur:contrast"].floatValue = 0.8916; configValues["decoration:blur:contrast"].floatValue = 0.8916;
configValues["decoration:blur:brightness"].floatValue = 1.0; configValues["decoration:blur:brightness"].floatValue = 1.0;
configValues["decoration:blur:vibrancy"].floatValue = 0.1696; configValues["decoration:blur:vibrancy"].floatValue = 0.1696;
configValues["decoration:blur:vibrancy_darkness"].floatValue = 0.0; configValues["decoration:blur:vibrancy_darkness"].floatValue = 0.0;
configValues["decoration:blur:noise"].floatValue = 0.0117; configValues["decoration:blur:noise"].floatValue = 0.0117;
configValues["decoration:blur:special"].intValue = 0; configValues["decoration:blur:special"].intValue = 0;
configValues["decoration:blur:popups"].intValue = 0; configValues["decoration:blur:popups"].intValue = 0;
configValues["decoration:active_opacity"].floatValue = 1; configValues["decoration:blur:popups_ignorealpha"].floatValue = 0.2;
configValues["decoration:inactive_opacity"].floatValue = 1; configValues["decoration:active_opacity"].floatValue = 1;
configValues["decoration:fullscreen_opacity"].floatValue = 1; configValues["decoration:inactive_opacity"].floatValue = 1;
configValues["decoration:no_blur_on_oversized"].intValue = 0; configValues["decoration:fullscreen_opacity"].floatValue = 1;
configValues["decoration:drop_shadow"].intValue = 1; configValues["decoration:no_blur_on_oversized"].intValue = 0;
configValues["decoration:shadow_range"].intValue = 4; configValues["decoration:drop_shadow"].intValue = 1;
configValues["decoration:shadow_render_power"].intValue = 3; configValues["decoration:shadow_range"].intValue = 4;
configValues["decoration:shadow_ignore_window"].intValue = 1; configValues["decoration:shadow_render_power"].intValue = 3;
configValues["decoration:shadow_offset"].vecValue = Vector2D(); configValues["decoration:shadow_ignore_window"].intValue = 1;
configValues["decoration:shadow_scale"].floatValue = 1.f; configValues["decoration:shadow_offset"].vecValue = Vector2D();
configValues["decoration:col.shadow"].intValue = 0xee1a1a1a; configValues["decoration:shadow_scale"].floatValue = 1.f;
configValues["decoration:col.shadow_inactive"].intValue = INT_MAX; configValues["decoration:col.shadow"].intValue = 0xee1a1a1a;
configValues["decoration:dim_inactive"].intValue = 0; configValues["decoration:col.shadow_inactive"].intValue = INT_MAX;
configValues["decoration:dim_strength"].floatValue = 0.5f; configValues["decoration:dim_inactive"].intValue = 0;
configValues["decoration:dim_special"].floatValue = 0.2f; configValues["decoration:dim_strength"].floatValue = 0.5f;
configValues["decoration:dim_around"].floatValue = 0.4f; configValues["decoration:dim_special"].floatValue = 0.2f;
configValues["decoration:screen_shader"].strValue = STRVAL_EMPTY; configValues["decoration:dim_around"].floatValue = 0.4f;
configValues["decoration:screen_shader"].strValue = STRVAL_EMPTY;
configValues["dwindle:pseudotile"].intValue = 0; configValues["dwindle:pseudotile"].intValue = 0;
configValues["dwindle:force_split"].intValue = 0; configValues["dwindle:force_split"].intValue = 0;

View file

@ -50,7 +50,8 @@ CHyprRenderer::CHyprRenderer() {
} }
static void renderSurface(struct wlr_surface* surface, int x, int y, void* data) { static void renderSurface(struct wlr_surface* surface, int x, int y, void* data) {
static auto* const PBLURPOPUPS = &g_pConfigManager->getConfigValuePtr("decoration:blur:popups")->intValue; static auto* const PBLURPOPUPS = &g_pConfigManager->getConfigValuePtr("decoration:blur:popups")->intValue;
static auto* const PBLURPOPUPSIGNOREALPHA = &g_pConfigManager->getConfigValuePtr("decoration:blur:popups_ignorealpha")->floatValue;
const auto TEXTURE = wlr_surface_get_texture(surface); const auto TEXTURE = wlr_surface_get_texture(surface);
const auto RDATA = (SRenderData*)data; const auto RDATA = (SRenderData*)data;
@ -136,9 +137,16 @@ static void renderSurface(struct wlr_surface* surface, int x, int y, void* data)
g_pHyprOpenGL->renderTexture(TEXTURE, &windowBox, RDATA->fadeAlpha * RDATA->alpha, rounding, true); g_pHyprOpenGL->renderTexture(TEXTURE, &windowBox, RDATA->fadeAlpha * RDATA->alpha, rounding, true);
} }
} else { } else {
if (RDATA->blur && RDATA->popup && *PBLURPOPUPS) if (RDATA->blur && RDATA->popup && *PBLURPOPUPS) {
if (*PBLURPOPUPSIGNOREALPHA != 1.f) {
g_pHyprOpenGL->m_RenderData.discardMode |= DISCARD_ALPHA;
g_pHyprOpenGL->m_RenderData.discardOpacity = *PBLURPOPUPSIGNOREALPHA;
}
g_pHyprOpenGL->renderTextureWithBlur(TEXTURE, &windowBox, RDATA->fadeAlpha * RDATA->alpha, surface, rounding, true); g_pHyprOpenGL->renderTextureWithBlur(TEXTURE, &windowBox, RDATA->fadeAlpha * RDATA->alpha, surface, rounding, true);
else g_pHyprOpenGL->m_RenderData.discardMode &= ~DISCARD_ALPHA;
} else
g_pHyprOpenGL->renderTexture(TEXTURE, &windowBox, RDATA->fadeAlpha * RDATA->alpha, rounding, true); g_pHyprOpenGL->renderTexture(TEXTURE, &windowBox, RDATA->fadeAlpha * RDATA->alpha, rounding, true);
} }