From 29cdd7de1f8d99462915540569fbe54f10f609f4 Mon Sep 17 00:00:00 2001 From: Vaxry Date: Wed, 28 Feb 2024 15:59:45 +0000 Subject: [PATCH] layers: minor fixes for new animations --- src/events/Layers.cpp | 13 +++++++++++++ src/helpers/WLClasses.cpp | 2 +- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/src/events/Layers.cpp b/src/events/Layers.cpp index 1b76c536..5e9de8b4 100644 --- a/src/events/Layers.cpp +++ b/src/events/Layers.cpp @@ -325,6 +325,19 @@ void Events::listener_commitLayerSurface(void* owner, void* data) { } } + if (layersurface->realPosition.goalv() != layersurface->geometry.pos()) { + if (layersurface->realPosition.isBeingAnimated()) + layersurface->realPosition = layersurface->geometry.pos(); + else + layersurface->realPosition.setValueAndWarp(layersurface->geometry.pos()); + } + if (layersurface->realSize.goalv() != layersurface->geometry.size()) { + if (layersurface->realSize.isBeingAnimated()) + layersurface->realSize = layersurface->geometry.size(); + else + layersurface->realSize.setValueAndWarp(layersurface->geometry.size()); + } + if (layersurface->layerSurface->current.keyboard_interactive && (!g_pCompositor->m_sSeat.mouse || !g_pCompositor->m_sSeat.mouse->currentConstraint) // don't focus if constrained && !layersurface->keyboardExclusive && layersurface->mapped) { diff --git a/src/helpers/WLClasses.cpp b/src/helpers/WLClasses.cpp index 3abcf0a5..43bba7c5 100644 --- a/src/helpers/WLClasses.cpp +++ b/src/helpers/WLClasses.cpp @@ -54,7 +54,7 @@ void SLayerSurface::applyRules() { xray = configStringToInt(vars[1]); } catch (...) {} } else if (rule.rule.starts_with("animation")) { - CVarList vars{rule.rule, 0, 's'}; + CVarList vars{rule.rule, 2, 's'}; animationStyle = vars[1]; } }