internal: allow opening empty special workspaces

Fixes point 2 of #2596
This commit is contained in:
vaxerski 2023-08-25 18:05:08 +02:00
parent 23e17700a7
commit 870471dd96
5 changed files with 47 additions and 37 deletions

View file

@ -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();