From 793d24e6b53782b42a634d0f082987277c754661 Mon Sep 17 00:00:00 2001 From: nnra <104775644+nnra6864@users.noreply.github.com> Date: Wed, 19 Nov 2025 20:07:46 +0100 Subject: [PATCH] all: Window rules V3 Fixes (#541) --- borders-plus-plus/borderDeco.cpp | 2 +- hyprbars/barDeco.hpp | 2 +- hyprfocus/main.cpp | 6 +++--- hyprscrolling/Scrolling.cpp | 6 +++--- hyprtrails/trail.cpp | 2 +- 5 files changed, 9 insertions(+), 9 deletions(-) diff --git a/borders-plus-plus/borderDeco.cpp b/borders-plus-plus/borderDeco.cpp index c8f1b44..2479939 100644 --- a/borders-plus-plus/borderDeco.cpp +++ b/borders-plus-plus/borderDeco.cpp @@ -68,7 +68,7 @@ void CBordersPlusPlus::draw(PHLMONITOR pMonitor, const float& a) { const auto PWINDOW = m_pWindow.lock(); - if (!PWINDOW->m_windowData.decorate.valueOrDefault()) + if (!PWINDOW->m_ruleApplicator->decorate().valueOrDefault()) return; CBorderPPPassElement::SBorderPPData data; diff --git a/hyprbars/barDeco.hpp b/hyprbars/barDeco.hpp index f0af211..1200b4b 100644 --- a/hyprbars/barDeco.hpp +++ b/hyprbars/barDeco.hpp @@ -6,7 +6,7 @@ #include #include #include -#include +#include #include #include #include "globals.hpp" diff --git a/hyprfocus/main.cpp b/hyprfocus/main.cpp index 26ff81a..2f74af2 100644 --- a/hyprfocus/main.cpp +++ b/hyprfocus/main.cpp @@ -52,15 +52,15 @@ static void onFocusChange(PHLWINDOW window) { const auto POUT = g_pConfigManager->getAnimationPropertyConfig("hyprfocusOut"); if (*PMODE == "flash") { + const auto ORIGINAL = window->m_activeInactiveAlpha->goal(); window->m_activeInactiveAlpha->setConfig(PIN); *window->m_activeInactiveAlpha = std::clamp(*POPACITY, 0.F, 1.F); - window->m_activeInactiveAlpha->setCallbackOnEnd([w = PHLWINDOWREF{window}, POUT](WP pav) { + window->m_activeInactiveAlpha->setCallbackOnEnd([w = PHLWINDOWREF{window}, POUT, ORIGINAL](WP pav) { if (!w) return; w->m_activeInactiveAlpha->setConfig(POUT); - g_pCompositor->updateWindowAnimatedDecorationValues(w.lock()); - w->updateDynamicRules(); + *w->m_activeInactiveAlpha = ORIGINAL; w->m_activeInactiveAlpha->setCallbackOnEnd(nullptr); }); diff --git a/hyprscrolling/Scrolling.cpp b/hyprscrolling/Scrolling.cpp index af97822..5ae8bd5 100644 --- a/hyprscrolling/Scrolling.cpp +++ b/hyprscrolling/Scrolling.cpp @@ -385,7 +385,7 @@ void CScrollingLayout::applyNodeDataToWindow(SP data, bool if (PWINDOW->isFullscreen() && !data->ignoreFullscreenChecks) return; - PWINDOW->unsetWindowData(PRIORITY_LAYOUT); + PWINDOW->m_ruleApplicator->resetProps(Desktop::Rule::RULE_PROP_ALL, Desktop::Types::PRIORITY_LAYOUT); PWINDOW->updateWindowData(); static auto PGAPSINDATA = CConfigValue("general:gaps_in"); @@ -641,7 +641,7 @@ void CScrollingLayout::resizeActiveWindow(const Vector2D& delta, eRectCorner cor if (!DATA) { *PWINDOW->m_realSize = (PWINDOW->m_realSize->goal() + delta) - .clamp(PWINDOW->m_windowData.minSize.valueOr(Vector2D{MIN_WINDOW_SIZE, MIN_WINDOW_SIZE}), PWINDOW->m_windowData.maxSize.valueOr(Vector2D{INFINITY, INFINITY})); + .clamp(PWINDOW->m_ruleApplicator->minSize().valueOr(Vector2D{MIN_WINDOW_SIZE, MIN_WINDOW_SIZE}), PWINDOW->m_ruleApplicator->maxSize().valueOr(Vector2D{INFINITY, INFINITY})); PWINDOW->updateWindowDecos(); return; } @@ -753,7 +753,7 @@ void CScrollingLayout::fullscreenRequestForWindow(PHLWINDOW pWindow, const eFull *pWindow->m_realPosition = pWindow->m_lastFloatingPosition; *pWindow->m_realSize = pWindow->m_lastFloatingSize; - pWindow->unsetWindowData(PRIORITY_LAYOUT); + pWindow->m_ruleApplicator->resetProps(Desktop::Rule::RULE_PROP_ALL, Desktop::Types::PRIORITY_LAYOUT); pWindow->updateWindowData(); } } else { diff --git a/hyprtrails/trail.cpp b/hyprtrails/trail.cpp index 9820fda..7bf4f31 100644 --- a/hyprtrails/trail.cpp +++ b/hyprtrails/trail.cpp @@ -87,7 +87,7 @@ void CTrail::draw(PHLMONITOR pMonitor, const float& a) { const auto PWINDOW = m_pWindow.lock(); - if (!PWINDOW->m_windowData.decorate.valueOrDefault()) + if (!PWINDOW->m_ruleApplicator->decorate().valueOrDefault()) return; auto data = CTrailPassElement::STrailData{this, a};