summaryrefslogtreecommitdiff
path: root/src/events/Layers.cpp
diff options
context:
space:
mode:
authorVaxry <vaxry@vaxry.net>2024-02-28 15:00:34 +0000
committerVaxry <vaxry@vaxry.net>2024-02-28 15:00:40 +0000
commit4bc669f9331bb66ab30bd705d09f1239bc3e83ed (patch)
tree0ffdfa24b039b601080c6a49699a8d73b779ed8a /src/events/Layers.cpp
parentf4f3aa2e505ca1b22688fb4a32f31c4bfb851dd0 (diff)
layers: add fully featured animations
Adds configs and layerrules to handle them alas fixes #981 I have cooked
Diffstat (limited to 'src/events/Layers.cpp')
-rw-r--r--src/events/Layers.cpp18
1 files changed, 4 insertions, 14 deletions
diff --git a/src/events/Layers.cpp b/src/events/Layers.cpp
index 9ef9b025..1b76c536 100644
--- a/src/events/Layers.cpp
+++ b/src/events/Layers.cpp
@@ -113,9 +113,6 @@ void Events::listener_mapLayerSurface(void* owner, void* data) {
layersurface->keyboardExclusive = layersurface->layerSurface->current.keyboard_interactive;
layersurface->surface = layersurface->layerSurface->surface;
- // anim
- layersurface->alpha.setConfig(g_pConfigManager->getAnimationPropertyConfig("fadeIn"));
-
// fix if it changed its mon
const auto PMONITOR = g_pCompositor->getMonitorFromOutput(layersurface->layerSurface->output);
@@ -166,8 +163,7 @@ void Events::listener_mapLayerSurface(void* owner, void* data) {
const auto WORKSPACE = g_pCompositor->getWorkspaceByID(PMONITOR->activeWorkspace);
const bool FULLSCREEN = WORKSPACE->m_bHasFullscreenWindow && WORKSPACE->m_efFullscreenMode == FULLSCREEN_FULL;
- layersurface->alpha.setValue(0);
- layersurface->alpha = ((layersurface->layer == ZWLR_LAYER_SHELL_V1_LAYER_TOP && FULLSCREEN && !GRABSFOCUS) ? 0.f : 1.f);
+ layersurface->startAnimation(!(layersurface->layer == ZWLR_LAYER_SHELL_V1_LAYER_TOP && FULLSCREEN && !GRABSFOCUS));
layersurface->readyToDelete = false;
layersurface->fadingOut = false;
@@ -198,22 +194,16 @@ void Events::listener_unmapLayerSurface(void* owner, void* data) {
layersurface->mapped = false;
- layersurface->fadingOut = true;
-
- layersurface->alpha.setValueAndWarp(0.f);
+ layersurface->startAnimation(false);
return;
}
- // anim
- layersurface->alpha.setConfig(g_pConfigManager->getAnimationPropertyConfig("fadeOut"));
-
// make a snapshot and start fade
g_pHyprOpenGL->makeLayerSnapshot(layersurface);
- layersurface->alpha = 0.f;
- layersurface->mapped = false;
+ layersurface->startAnimation(false);
- layersurface->fadingOut = true;
+ layersurface->mapped = false;
g_pCompositor->addToFadingOutSafe(layersurface);