windowrules: rewrite completely (#12269)

Reworks the window rule syntax completely

---------

Co-authored-by: Mihai Fufezan <mihai@fufexan.net>
This commit is contained in:
Vaxry 2025-11-17 18:34:02 +00:00 committed by GitHub
parent 95ee08b340
commit c2670e9ab9
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
93 changed files with 3574 additions and 2255 deletions

View file

@ -98,7 +98,7 @@ static void handleUpdate(CAnimatedVariable<VarType>& av, bool warp) {
if (!PMONITOR)
return;
animationsDisabled = PWINDOW->m_windowData.noAnim.valueOr(animationsDisabled);
animationsDisabled = PWINDOW->m_ruleApplicator->noAnim().valueOr(animationsDisabled);
} else if (PWORKSPACE) {
PMONITOR = PWORKSPACE->m_monitor.lock();
if (!PMONITOR)
@ -142,7 +142,7 @@ static void handleUpdate(CAnimatedVariable<VarType>& av, bool warp) {
PMONITOR = g_pCompositor->getMonitorFromVector(PLAYER->m_realPosition->goal() + PLAYER->m_realSize->goal() / 2.F);
if (!PMONITOR)
return;
animationsDisabled = animationsDisabled || PLAYER->m_noAnimations;
animationsDisabled = animationsDisabled || PLAYER->m_ruleApplicator->noanim().valueOrDefault();
}
const auto SPENT = av.getPercent();

View file

@ -41,8 +41,8 @@ void CDesktopAnimationManager::startAnimation(PHLWINDOW pWindow, eAnimationType
if (!pWindow->m_realPosition->enabled() && !force)
return;
if (pWindow->m_windowData.animationStyle.hasValue()) {
const auto STYLE = pWindow->m_windowData.animationStyle.value();
if (pWindow->m_ruleApplicator->animationStyle().hasValue()) {
const auto STYLE = pWindow->m_ruleApplicator->animationStyle().value();
// the window has config'd special anim
if (STYLE.starts_with("slide")) {
CVarList animList2(STYLE, 0, 's');
@ -106,7 +106,7 @@ void CDesktopAnimationManager::startAnimation(PHLLS ls, eAnimationType type, boo
ls->m_alpha->setConfig(g_pConfigManager->getAnimationPropertyConfig("fadeLayersOut"));
}
const auto ANIMSTYLE = ls->m_animationStyle.value_or(ls->m_realPosition->getStyle());
const auto ANIMSTYLE = ls->m_ruleApplicator->animationStyle().valueOr(ls->m_realPosition->getStyle());
if (ANIMSTYLE.starts_with("slide")) {
// get closest edge
const auto MIDDLE = ls->m_geometry.middle();