From de3471b3356280e692109cea81e426b7222a8aea Mon Sep 17 00:00:00 2001 From: ItsOhen Date: Fri, 13 Mar 2026 22:50:34 +0100 Subject: config/workspacerule: add animation style (#13380) --- src/managers/animation/DesktopAnimationManager.cpp | 8 +++++--- src/managers/animation/DesktopAnimationManager.hpp | 3 ++- 2 files changed, 7 insertions(+), 4 deletions(-) (limited to 'src/managers') diff --git a/src/managers/animation/DesktopAnimationManager.cpp b/src/managers/animation/DesktopAnimationManager.cpp index 2c450add..224fc52f 100644 --- a/src/managers/animation/DesktopAnimationManager.cpp +++ b/src/managers/animation/DesktopAnimationManager.cpp @@ -1,6 +1,7 @@ #include "DesktopAnimationManager.hpp" #include +#include #include "../../desktop/view/LayerSurface.hpp" #include "../../desktop/view/Window.hpp" @@ -232,7 +233,7 @@ void CDesktopAnimationManager::startAnimation(PHLLS ls, eAnimationType type, boo } } -void CDesktopAnimationManager::startAnimation(PHLWORKSPACE ws, eAnimationType type, bool left, bool instant) { +void CDesktopAnimationManager::startAnimation(PHLWORKSPACE ws, eAnimationType type, bool left, bool instant, std::optional style) { const bool IN = type == ANIMATION_TYPE_IN; if (!instant) { @@ -243,8 +244,9 @@ void CDesktopAnimationManager::startAnimation(PHLWORKSPACE ws, eAnimationType ty } static auto PWORKSPACEGAP = CConfigValue("general:gaps_workspaces"); const auto PMONITOR = ws->m_monitor.lock(); - const auto ANIMSTYLE = ws->m_alpha->getStyle(); - float movePerc = 100.f; + const auto ANIMSTYLE = style.value_or(ws->m_alpha->getStyle()); + + float movePerc = 100.f; // inverted for some reason. TODO: fix the cause bool vert = ANIMSTYLE.starts_with("slidevert") || ANIMSTYLE.starts_with("slidefadevert"); diff --git a/src/managers/animation/DesktopAnimationManager.hpp b/src/managers/animation/DesktopAnimationManager.hpp index fa86425e..92aadb9f 100644 --- a/src/managers/animation/DesktopAnimationManager.hpp +++ b/src/managers/animation/DesktopAnimationManager.hpp @@ -3,6 +3,7 @@ #include "../../helpers/memory/Memory.hpp" #include "../../desktop/DesktopTypes.hpp" #include +#include class CDesktopAnimationManager { public: @@ -13,7 +14,7 @@ class CDesktopAnimationManager { void startAnimation(PHLWINDOW w, eAnimationType type, bool force = false); void startAnimation(PHLLS ls, eAnimationType type, bool instant = false); - void startAnimation(PHLWORKSPACE ws, eAnimationType type, bool left = true, bool instant = false); + void startAnimation(PHLWORKSPACE ws, eAnimationType type, bool left = true, bool instant = false, std::optional style = std::nullopt); void setFullscreenFadeAnimation(PHLWORKSPACE ws, eAnimationType type); void setFullscreenFloatingFade(PHLWINDOW pWindow, float fade); -- cgit v1.2.3