From dc1737f12891957c9989f0fb732f404e67dc425e Mon Sep 17 00:00:00 2001 From: vaxerski <43317083+vaxerski@users.noreply.github.com> Date: Mon, 17 Oct 2022 23:23:01 +0100 Subject: [PATCH] allow glob wildcard in addreserved --- src/render/Renderer.cpp | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/render/Renderer.cpp b/src/render/Renderer.cpp index 71bfaab7..a4b737f0 100644 --- a/src/render/Renderer.cpp +++ b/src/render/Renderer.cpp @@ -760,9 +760,15 @@ void CHyprRenderer::arrangeLayersForMonitor(const int& monitor) { PMONITOR->vecReservedTopLeft = Vector2D(usableArea.x, usableArea.y) - PMONITOR->vecPosition; PMONITOR->vecReservedBottomRight = PMONITOR->vecSize - Vector2D(usableArea.width, usableArea.height) - PMONITOR->vecReservedTopLeft; - const auto ENTRY = g_pConfigManager->m_mAdditionalReservedAreas[PMONITOR->szName]; - PMONITOR->vecReservedTopLeft = PMONITOR->vecReservedTopLeft + Vector2D(ENTRY.left, ENTRY.top); - PMONITOR->vecReservedBottomRight = PMONITOR->vecReservedBottomRight + Vector2D(ENTRY.right, ENTRY.bottom); + auto ADDITIONALRESERVED = g_pConfigManager->m_mAdditionalReservedAreas.find(PMONITOR->szName); + if (ADDITIONALRESERVED == g_pConfigManager->m_mAdditionalReservedAreas.end()) { + ADDITIONALRESERVED = g_pConfigManager->m_mAdditionalReservedAreas.find(""); // glob wildcard + } + + if (ADDITIONALRESERVED != g_pConfigManager->m_mAdditionalReservedAreas.end()) { + PMONITOR->vecReservedTopLeft = PMONITOR->vecReservedTopLeft + Vector2D(ADDITIONALRESERVED->second.left, ADDITIONALRESERVED->second.top); + PMONITOR->vecReservedBottomRight = PMONITOR->vecReservedBottomRight + Vector2D(ADDITIONALRESERVED->second.right, ADDITIONALRESERVED->second.bottom); + } // damage the monitor if can if (PMONITOR->damage)