From b9a783229b3b5c0b4fad39245c80064700bc4338 Mon Sep 17 00:00:00 2001 From: vaxerski Date: Mon, 14 Aug 2023 18:41:52 +0200 Subject: [PATCH] compositor: don't apply offsets in renderer --- src/Compositor.cpp | 2 +- src/render/Renderer.cpp | 18 ------------------ 2 files changed, 1 insertion(+), 19 deletions(-) diff --git a/src/Compositor.cpp b/src/Compositor.cpp index 17e9b670..895b4bec 100644 --- a/src/Compositor.cpp +++ b/src/Compositor.cpp @@ -2496,7 +2496,7 @@ void CCompositor::arrangeMonitors() { for (auto it = toArrange.begin(); it != toArrange.end(); ++it) { auto m = *it; - if (m->activeMonitorRule.offset > Vector2D{-1, -1}) { + if (m->activeMonitorRule.offset.x >= 0 && m->activeMonitorRule.offset.y >= 0) { // explicit. m->moveTo(m->activeMonitorRule.offset); arranged.push_back(m); diff --git a/src/render/Renderer.cpp b/src/render/Renderer.cpp index fc19a42d..c6f15e1c 100644 --- a/src/render/Renderer.cpp +++ b/src/render/Renderer.cpp @@ -1879,24 +1879,6 @@ bool CHyprRenderer::applyMonitorRule(CMonitor* pMonitor, SMonitorRule* pMonitorR pMonitor->vecPixelSize = Vector2D(transformedBox.width, transformedBox.height); } - if (pMonitorRule->offset == Vector2D(-1, -1) && pMonitor->vecPosition == Vector2D(-1, -1)) { - // let's find manually a sensible position for it, to the right. - Vector2D finalPos; - - for (auto& m : g_pCompositor->m_vMonitors) { - if (m->ID == pMonitor->ID) - continue; - - if (m->vecPosition.x + std::ceil(m->vecSize.x) > finalPos.x) { - finalPos.x = m->vecPosition.x + std::ceil(m->vecSize.x); - } - } - - pMonitor->vecPosition = finalPos; - } else if (pMonitorRule->offset != Vector2D(-1, -1)) { - pMonitor->vecPosition = pMonitorRule->offset; - } - wlr_output_enable(pMonitor->output, 1); // update renderer (here because it will call rollback, so we cannot do this before committing)