renderer: add option to blur popups

closes #2134
This commit is contained in:
Vaxry 2023-12-25 18:04:00 +01:00
parent b25b06430b
commit e2d04ae503
3 changed files with 15 additions and 4 deletions

View file

@ -172,6 +172,7 @@ void CConfigManager::setDefaultVars() {
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:active_opacity"].floatValue = 1; configValues["decoration:active_opacity"].floatValue = 1;
configValues["decoration:inactive_opacity"].floatValue = 1; configValues["decoration:inactive_opacity"].floatValue = 1;
configValues["decoration:fullscreen_opacity"].floatValue = 1; configValues["decoration:fullscreen_opacity"].floatValue = 1;

View file

@ -97,6 +97,8 @@ struct SRenderData {
// for calculating UV // for calculating UV
CWindow* pWindow = nullptr; CWindow* pWindow = nullptr;
bool popup = false;
}; };
struct SExtensionFindingData { struct SExtensionFindingData {
@ -180,6 +182,7 @@ struct SConstraint {
Vector2D getLogicConstraintPos(); Vector2D getLogicConstraintPos();
Vector2D getLogicConstraintSize(); Vector2D getLogicConstraintSize();
//
bool operator==(const SConstraint& b) const { bool operator==(const SConstraint& b) const {
return constraint == b.constraint; return constraint == b.constraint;
} }

View file

@ -50,6 +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;
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;
@ -134,6 +136,9 @@ 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)
g_pHyprOpenGL->renderTextureWithBlur(TEXTURE, &windowBox, RDATA->fadeAlpha * RDATA->alpha, surface, rounding, true);
else
g_pHyprOpenGL->renderTexture(TEXTURE, &windowBox, RDATA->fadeAlpha * RDATA->alpha, rounding, true); g_pHyprOpenGL->renderTexture(TEXTURE, &windowBox, RDATA->fadeAlpha * RDATA->alpha, rounding, true);
} }
@ -544,6 +549,7 @@ void CHyprRenderer::renderWindow(CWindow* pWindow, CMonitor* pMonitor, timespec*
renderdata.dontRound = true; // don't round popups renderdata.dontRound = true; // don't round popups
renderdata.pMonitor = pMonitor; renderdata.pMonitor = pMonitor;
renderdata.squishOversized = false; // don't squish popups renderdata.squishOversized = false; // don't squish popups
renderdata.popup = true;
if (pWindow->m_sAdditionalConfigData.nearestNeighbor.toUnderlying()) if (pWindow->m_sAdditionalConfigData.nearestNeighbor.toUnderlying())
g_pHyprOpenGL->m_RenderData.useNearestNeighbor = true; g_pHyprOpenGL->m_RenderData.useNearestNeighbor = true;
@ -597,6 +603,7 @@ void CHyprRenderer::renderLayer(SLayerSurface* pLayer, CMonitor* pMonitor, times
renderdata.squishOversized = false; // don't squish popups renderdata.squishOversized = false; // don't squish popups
renderdata.dontRound = true; renderdata.dontRound = true;
renderdata.popup = true;
wlr_layer_surface_v1_for_each_popup_surface(pLayer->layerSurface, renderSurface, &renderdata); wlr_layer_surface_v1_for_each_popup_surface(pLayer->layerSurface, renderSurface, &renderdata);
g_pHyprOpenGL->m_pCurrentLayer = nullptr; g_pHyprOpenGL->m_pCurrentLayer = nullptr;