From 870471dd96724474869d2e648b623c17df12fb57 Mon Sep 17 00:00:00 2001 From: vaxerski <43317083+vaxerski@users.noreply.github.com> Date: Fri, 25 Aug 2023 18:05:08 +0200 Subject: internal: allow opening empty special workspaces Fixes point 2 of #2596 --- src/helpers/Workspace.cpp | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) (limited to 'src/helpers/Workspace.cpp') diff --git a/src/helpers/Workspace.cpp b/src/helpers/Workspace.cpp index eddd2143..09149ec8 100644 --- a/src/helpers/Workspace.cpp +++ b/src/helpers/Workspace.cpp @@ -66,9 +66,7 @@ void CWorkspace::startAnim(bool in, bool left, bool instant) { try { auto percstr = ANIMSTYLE.substr(ANIMSTYLE.find_last_of(' ') + 1); movePerc = std::stoi(percstr.substr(0, percstr.length() - 1)); - } catch (std::exception& e) { - Debug::log(ERR, "Error in startAnim: invalid percentage"); - } + } catch (std::exception& e) { Debug::log(ERR, "Error in startAnim: invalid percentage"); } } m_fAlpha.setValueAndWarp(1.f); @@ -133,6 +131,17 @@ void CWorkspace::startAnim(bool in, bool left, bool instant) { } } + if (m_bIsSpecialWorkspace) { + // required for open/close animations + if (in) { + m_fAlpha.setValueAndWarp(0.f); + m_fAlpha = 1.f; + } else { + m_fAlpha.setValueAndWarp(1.f); + m_fAlpha = 0.f; + } + } + if (instant) { m_vRenderOffset.warp(); m_fAlpha.warp(); -- cgit v1.2.3