compositor: don't apply offsets in renderer

This commit is contained in:
Vaxry 2023-08-14 18:41:52 +02:00
parent 2110dc1f03
commit b9a783229b
2 changed files with 1 additions and 19 deletions

View file

@ -2496,7 +2496,7 @@ void CCompositor::arrangeMonitors() {
for (auto it = toArrange.begin(); it != toArrange.end(); ++it) { for (auto it = toArrange.begin(); it != toArrange.end(); ++it) {
auto m = *it; auto m = *it;
if (m->activeMonitorRule.offset > Vector2D{-1, -1}) { if (m->activeMonitorRule.offset.x >= 0 && m->activeMonitorRule.offset.y >= 0) {
// explicit. // explicit.
m->moveTo(m->activeMonitorRule.offset); m->moveTo(m->activeMonitorRule.offset);
arranged.push_back(m); arranged.push_back(m);

View file

@ -1879,24 +1879,6 @@ bool CHyprRenderer::applyMonitorRule(CMonitor* pMonitor, SMonitorRule* pMonitorR
pMonitor->vecPixelSize = Vector2D(transformedBox.width, transformedBox.height); 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); wlr_output_enable(pMonitor->output, 1);
// update renderer (here because it will call rollback, so we cannot do this before committing) // update renderer (here because it will call rollback, so we cannot do this before committing)