aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/desktop/Window.cpp
diff options
context:
space:
mode:
authorVaxry <[email protected]>2024-08-28 21:54:49 +0200
committerVaxry <[email protected]>2024-08-28 21:54:49 +0200
commitb9b8e6220f55af34e862b541a5a4b30ae6d8f15f (patch)
treea9adf95c9adba48714bf1f3c2acb857f35e0cfa4 /src/desktop/Window.cpp
parenta95df6b57e68785c13fd2d7f93d9eba28b9406ed (diff)
downloadHyprland-b9b8e6220f55af34e862b541a5a4b30ae6d8f15f.tar.gz
Hyprland-b9b8e6220f55af34e862b541a5a4b30ae6d8f15f.zip
renderer: fade out windows on silent moves
Diffstat (limited to 'src/desktop/Window.cpp')
-rw-r--r--src/desktop/Window.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/desktop/Window.cpp b/src/desktop/Window.cpp
index 7da616c1..a4ba366a 100644
--- a/src/desktop/Window.cpp
+++ b/src/desktop/Window.cpp
@@ -31,6 +31,7 @@ PHLWINDOW CWindow::create(SP<CXWaylandSurface> surface) {
pWindow->m_fActiveInactiveAlpha.create(g_pConfigManager->getAnimationPropertyConfig("fadeSwitch"), pWindow, AVARDAMAGE_ENTIRE);
pWindow->m_cRealShadowColor.create(g_pConfigManager->getAnimationPropertyConfig("fadeShadow"), pWindow, AVARDAMAGE_SHADOW);
pWindow->m_fDimPercent.create(g_pConfigManager->getAnimationPropertyConfig("fadeDim"), pWindow, AVARDAMAGE_ENTIRE);
+ pWindow->m_fMovingToWorkspaceAlpha.create(g_pConfigManager->getAnimationPropertyConfig("fadeOut"), pWindow, AVARDAMAGE_ENTIRE);
pWindow->addWindowDeco(std::make_unique<CHyprDropShadowDecoration>(pWindow));
pWindow->addWindowDeco(std::make_unique<CHyprBorderDecoration>(pWindow));
@@ -52,6 +53,7 @@ PHLWINDOW CWindow::create(SP<CXDGSurfaceResource> resource) {
pWindow->m_fActiveInactiveAlpha.create(g_pConfigManager->getAnimationPropertyConfig("fadeSwitch"), pWindow, AVARDAMAGE_ENTIRE);
pWindow->m_cRealShadowColor.create(g_pConfigManager->getAnimationPropertyConfig("fadeShadow"), pWindow, AVARDAMAGE_SHADOW);
pWindow->m_fDimPercent.create(g_pConfigManager->getAnimationPropertyConfig("fadeDim"), pWindow, AVARDAMAGE_ENTIRE);
+ pWindow->m_fMovingToWorkspaceAlpha.create(g_pConfigManager->getAnimationPropertyConfig("fadeOut"), pWindow, AVARDAMAGE_ENTIRE);
pWindow->addWindowDeco(std::make_unique<CHyprDropShadowDecoration>(pWindow));
pWindow->addWindowDeco(std::make_unique<CHyprBorderDecoration>(pWindow));
@@ -407,6 +409,11 @@ void CWindow::moveToWorkspace(PHLWORKSPACE pWorkspace) {
const auto OLDWORKSPACE = m_pWorkspace;
+ m_iMonitorMovedFrom = OLDWORKSPACE ? OLDWORKSPACE->m_iMonitorID : -1;
+ m_fMovingToWorkspaceAlpha.setValueAndWarp(1.F);
+ m_fMovingToWorkspaceAlpha = 0.F;
+ m_fMovingToWorkspaceAlpha.setCallbackOnEnd([this](void* thisptr) { m_iMonitorMovedFrom = -1; });
+
m_pWorkspace = pWorkspace;
setAnimationsToMove();
@@ -502,6 +509,7 @@ void CWindow::onUnmap() {
m_fAlpha.setCallbackOnEnd(unregisterVar);
m_cRealShadowColor.setCallbackOnEnd(unregisterVar);
m_fDimPercent.setCallbackOnEnd(unregisterVar);
+ m_fMovingToWorkspaceAlpha.setCallbackOnEnd(unregisterVar);
m_vRealSize.setCallbackOnBegin(nullptr);
@@ -542,6 +550,7 @@ void CWindow::onMap() {
m_fAlpha.resetAllCallbacks();
m_cRealShadowColor.resetAllCallbacks();
m_fDimPercent.resetAllCallbacks();
+ m_fMovingToWorkspaceAlpha.resetAllCallbacks();
m_vRealPosition.registerVar();
m_vRealSize.registerVar();
@@ -551,6 +560,7 @@ void CWindow::onMap() {
m_fAlpha.registerVar();
m_cRealShadowColor.registerVar();
m_fDimPercent.registerVar();
+ m_fMovingToWorkspaceAlpha.registerVar();
m_fBorderAngleAnimationProgress.setCallbackOnEnd([&](void* ptr) { onBorderAngleAnimEnd(ptr); }, false);