aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/desktop/Window.cpp
diff options
context:
space:
mode:
authorVaxry <[email protected]>2024-12-22 16:04:10 +0000
committerVaxry <[email protected]>2024-12-22 16:04:10 +0000
commit1cc1a46c2e154a27750b81307040d3bf7ff0f64f (patch)
tree9639acd85448bfcbd797a0c5a34241ad650ac36b /src/desktop/Window.cpp
parent31422ae25dee33dd000798b64a80bd7fd08d2ece (diff)
downloadHyprland-1cc1a46c2e154a27750b81307040d3bf7ff0f64f.tar.gz
Hyprland-1cc1a46c2e154a27750b81307040d3bf7ff0f64f.zip
core: fade in windows when they are brought from invisible workspaces
Diffstat (limited to 'src/desktop/Window.cpp')
-rw-r--r--src/desktop/Window.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/desktop/Window.cpp b/src/desktop/Window.cpp
index 696bfc5b..871e73ed 100644
--- a/src/desktop/Window.cpp
+++ b/src/desktop/Window.cpp
@@ -33,6 +33,7 @@ PHLWINDOW CWindow::create(SP<CXWaylandSurface> surface) {
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->m_fMovingFromWorkspaceAlpha.create(g_pConfigManager->getAnimationPropertyConfig("fadeIn"), pWindow, AVARDAMAGE_ENTIRE);
pWindow->addWindowDeco(std::make_unique<CHyprDropShadowDecoration>(pWindow));
pWindow->addWindowDeco(std::make_unique<CHyprBorderDecoration>(pWindow));
@@ -55,6 +56,7 @@ PHLWINDOW CWindow::create(SP<CXDGSurfaceResource> resource) {
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->m_fMovingFromWorkspaceAlpha.create(g_pConfigManager->getAnimationPropertyConfig("fadeIn"), pWindow, AVARDAMAGE_ENTIRE);
pWindow->addWindowDeco(std::make_unique<CHyprDropShadowDecoration>(pWindow));
pWindow->addWindowDeco(std::make_unique<CHyprBorderDecoration>(pWindow));
@@ -504,6 +506,7 @@ void CWindow::onUnmap() {
m_cRealShadowColor.setCallbackOnEnd(unregisterVar);
m_fDimPercent.setCallbackOnEnd(unregisterVar);
m_fMovingToWorkspaceAlpha.setCallbackOnEnd(unregisterVar);
+ m_fMovingFromWorkspaceAlpha.setCallbackOnEnd(unregisterVar);
m_vRealSize.setCallbackOnBegin(nullptr);
@@ -547,6 +550,7 @@ void CWindow::onMap() {
m_cRealShadowColor.resetAllCallbacks();
m_fDimPercent.resetAllCallbacks();
m_fMovingToWorkspaceAlpha.resetAllCallbacks();
+ m_fMovingFromWorkspaceAlpha.resetAllCallbacks();
m_vRealPosition.registerVar();
m_vRealSize.registerVar();
@@ -557,12 +561,15 @@ void CWindow::onMap() {
m_cRealShadowColor.registerVar();
m_fDimPercent.registerVar();
m_fMovingToWorkspaceAlpha.registerVar();
+ m_fMovingFromWorkspaceAlpha.registerVar();
m_fBorderAngleAnimationProgress.setCallbackOnEnd([&](void* ptr) { onBorderAngleAnimEnd(ptr); }, false);
m_fBorderAngleAnimationProgress.setValueAndWarp(0.f);
m_fBorderAngleAnimationProgress = 1.f;
+ m_fMovingFromWorkspaceAlpha.setValueAndWarp(1.F);
+
g_pCompositor->m_vWindowFocusHistory.push_back(m_pSelf);
m_vReportedSize = m_vPendingReportedSize;