mirror of
https://github.com/hyprwm/Hyprland
synced 2024-11-22 14:45:59 +01:00
avoid layout changes when unnecessary in applyMonitorRule
This commit is contained in:
parent
74d05d0adc
commit
05f3eebd96
1 changed files with 9 additions and 4 deletions
|
@ -1214,16 +1214,21 @@ bool CHyprRenderer::applyMonitorRule(CMonitor* pMonitor, SMonitorRule* pMonitorR
|
|||
pMonitor->vecPosition = pMonitorRule->offset;
|
||||
}
|
||||
|
||||
if (!pMonitor->isMirror())
|
||||
wlr_output_layout_add(g_pCompositor->m_sWLROutputLayout, pMonitor->output, (int)pMonitor->vecPosition.x, (int)pMonitor->vecPosition.y);
|
||||
|
||||
wlr_output_enable(pMonitor->output, true);
|
||||
|
||||
// update renderer (here because it will call rollback, so we cannot do this before committing)
|
||||
g_pHyprOpenGL->destroyMonitorResources(pMonitor);
|
||||
|
||||
// updato wlroots
|
||||
Events::listener_change(nullptr, nullptr);
|
||||
if (!pMonitor->isMirror()) {
|
||||
wlr_box box = {0, 0, 0, 0};
|
||||
wlr_output_layout_get_box(g_pCompositor->m_sWLROutputLayout, pMonitor->output, &box);
|
||||
|
||||
if (!DELTALESSTHAN(box.x, pMonitor->vecPosition.x, 1) || !DELTALESSTHAN(box.y, pMonitor->vecPosition.y, 1)) {
|
||||
wlr_output_layout_add(g_pCompositor->m_sWLROutputLayout, pMonitor->output, (int)pMonitor->vecPosition.x, (int)pMonitor->vecPosition.y);
|
||||
Events::listener_change(nullptr, nullptr);
|
||||
}
|
||||
}
|
||||
|
||||
// updato us
|
||||
arrangeLayersForMonitor(pMonitor->ID);
|
||||
|
|
Loading…
Reference in a new issue