diff options
Diffstat (limited to 'src/events/Layers.cpp')
-rw-r--r-- | src/events/Layers.cpp | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/src/events/Layers.cpp b/src/events/Layers.cpp index 65f679d5..a7135953 100644 --- a/src/events/Layers.cpp +++ b/src/events/Layers.cpp @@ -112,6 +112,8 @@ void Events::listener_mapLayerSurface(void* owner, void* data) { layersurface->layerSurface->mapped = true; layersurface->mapped = true; + layersurface->surface = layersurface->layerSurface->surface; + // anim layersurface->alpha.setConfig(g_pConfigManager->getAnimationPropertyConfig("fadeIn")); @@ -121,10 +123,7 @@ void Events::listener_mapLayerSurface(void* owner, void* data) { if (!PMONITOR) return; - for (auto& rule : g_pConfigManager->getMatchingRules(layersurface)) { - if (rule.rule == "noanim") - layersurface->noAnimations = true; - } + layersurface->applyRules(); if ((uint64_t)layersurface->monitorID != PMONITOR->ID) { const auto POLDMON = g_pCompositor->getMonitorFromID(layersurface->monitorID); @@ -210,12 +209,15 @@ void Events::listener_unmapLayerSurface(void* owner, void* data) { const auto PMONITOR = g_pCompositor->getMonitorFromOutput(layersurface->layerSurface->output); + const bool WASLASTFOCUS = g_pCompositor->m_pLastFocus == layersurface->layerSurface->surface; + + layersurface->surface = nullptr; + if (!PMONITOR) return; // refocus if needed - if (layersurface->layerSurface->surface == g_pCompositor->m_pLastFocus) { - + if (WASLASTFOCUS) { Vector2D surfaceCoords; SLayerSurface* pFoundLayerSurface = nullptr; wlr_surface* foundSurface = nullptr; |