From 24df15105ee2fc7f2975ef2958c2e7b1258569d1 Mon Sep 17 00:00:00 2001 From: vaxerski <43317083+vaxerski@users.noreply.github.com> Date: Sun, 17 Apr 2022 10:46:04 +0200 Subject: [PATCH] don't rearrange layersurfaces when not needed --- src/events/Layers.cpp | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/src/events/Layers.cpp b/src/events/Layers.cpp index 4aac1a74..c6295e70 100644 --- a/src/events/Layers.cpp +++ b/src/events/Layers.cpp @@ -145,15 +145,17 @@ void Events::listener_commitLayerSurface(void* owner, void* data) { g_pHyprRenderer->arrangeLayersForMonitor(POLDMON->ID); } - g_pHyprRenderer->arrangeLayersForMonitor(PMONITOR->ID); + if (layersurface->layerSurface->current.committed != 0) { + g_pHyprRenderer->arrangeLayersForMonitor(PMONITOR->ID); - if (layersurface->layer != layersurface->layerSurface->current.layer) { - PMONITOR->m_aLayerSurfaceLists[layersurface->layer].remove(layersurface); - PMONITOR->m_aLayerSurfaceLists[layersurface->layerSurface->current.layer].push_back(layersurface); - layersurface->layer = layersurface->layerSurface->current.layer; + if (layersurface->layer != layersurface->layerSurface->current.layer) { + PMONITOR->m_aLayerSurfaceLists[layersurface->layer].remove(layersurface); + PMONITOR->m_aLayerSurfaceLists[layersurface->layerSurface->current.layer].push_back(layersurface); + layersurface->layer = layersurface->layerSurface->current.layer; + } + + g_pLayoutManager->getCurrentLayout()->recalculateMonitor(PMONITOR->ID); } - g_pLayoutManager->getCurrentLayout()->recalculateMonitor(PMONITOR->ID); - layersurface->position = Vector2D(layersurface->geometry.x, layersurface->geometry.y); } \ No newline at end of file