mirror of
https://github.com/hyprwm/Hyprland
synced 2025-02-17 01:02:51 +01:00
allow preblur for opaque surfaces if alpha not 1
This commit is contained in:
parent
c074f260a1
commit
2a5ae435e1
1 changed files with 10 additions and 9 deletions
|
@ -735,15 +735,16 @@ void CHyprOpenGLImpl::preRender(CMonitor* pMonitor) {
|
|||
|
||||
const auto PSURFACE = g_pXWaylandManager->getWindowSurface(pWindow);
|
||||
|
||||
const auto PWORKSPACE = g_pCompositor->getWorkspaceByID(pWindow->m_iWorkspaceID);
|
||||
const float A = pWindow->m_fAlpha.fl() * pWindow->m_fActiveInactiveAlpha.fl() * PWORKSPACE->m_fAlpha.fl();
|
||||
|
||||
if (A >= 1.f) {
|
||||
if (PSURFACE->opaque)
|
||||
return false;
|
||||
|
||||
pixman_region32_t inverseOpaque;
|
||||
pixman_region32_init(&inverseOpaque);
|
||||
const auto PWORKSPACE = g_pCompositor->getWorkspaceByID(pWindow->m_iWorkspaceID);
|
||||
const float A = pWindow->m_fAlpha.fl() * pWindow->m_fActiveInactiveAlpha.fl() * PWORKSPACE->m_fAlpha.fl();
|
||||
|
||||
if (A >= 1.f) {
|
||||
pixman_box32_t surfbox = {0, 0, PSURFACE->current.width, PSURFACE->current.height};
|
||||
pixman_region32_copy(&inverseOpaque, &PSURFACE->current.opaque);
|
||||
pixman_region32_inverse(&inverseOpaque, &inverseOpaque, &surfbox);
|
||||
|
@ -753,9 +754,9 @@ void CHyprOpenGLImpl::preRender(CMonitor* pMonitor) {
|
|||
pixman_region32_fini(&inverseOpaque);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
pixman_region32_fini(&inverseOpaque);
|
||||
}
|
||||
|
||||
return true;
|
||||
};
|
||||
|
|
Loading…
Add table
Reference in a new issue