From ba05c43ae3cb680e5d728c5a7457cf6c3d333854 Mon Sep 17 00:00:00 2001 From: vaxerski <43317083+vaxerski@users.noreply.github.com> Date: Fri, 18 Nov 2022 14:15:19 +0000 Subject: [PATCH] minor monitor code fixups --- src/helpers/Monitor.cpp | 4 +--- src/render/Renderer.cpp | 9 +++------ 2 files changed, 4 insertions(+), 9 deletions(-) diff --git a/src/helpers/Monitor.cpp b/src/helpers/Monitor.cpp index fec78317..9e7ec66e 100644 --- a/src/helpers/Monitor.cpp +++ b/src/helpers/Monitor.cpp @@ -89,10 +89,8 @@ void CMonitor::onConnect(bool noRule) { } m_bEnabled = true; - - wlr_output_set_scale(output, monitorRule.scale); + wlr_xcursor_manager_load(g_pCompositor->m_sWLRXCursorMgr, monitorRule.scale); - wlr_output_set_transform(output, WL_OUTPUT_TRANSFORM_NORMAL); // TODO: support other transforms // create it in the arr vecPosition = monitorRule.offset; diff --git a/src/render/Renderer.cpp b/src/render/Renderer.cpp index 978c58c2..ce1f83f0 100644 --- a/src/render/Renderer.cpp +++ b/src/render/Renderer.cpp @@ -1143,6 +1143,9 @@ bool CHyprRenderer::applyMonitorRule(CMonitor* pMonitor, SMonitorRule* pMonitorR wlr_output_set_scale(pMonitor->output, pMonitorRule->scale); pMonitor->scale = pMonitorRule->scale; + wlr_output_set_transform(pMonitor->output, pMonitorRule->transform); + pMonitor->transform = pMonitorRule->transform; + // loop over modes and choose an appropriate one. if (pMonitorRule->resolution != Vector2D() && pMonitorRule->resolution != Vector2D(-1,-1) && pMonitorRule->resolution != Vector2D(-1,-2)) { if (!wl_list_empty(&pMonitor->output->modes)) { @@ -1339,9 +1342,6 @@ bool CHyprRenderer::applyMonitorRule(CMonitor* pMonitor, SMonitorRule* pMonitorR pMonitor->vrrActive = pMonitor->output->pending.adaptive_sync_enabled; // disabled here, will be tested in CConfigManager::ensureVRR() - wlr_output_set_transform(pMonitor->output, pMonitorRule->transform); - pMonitor->transform = pMonitorRule->transform; - pMonitor->vecPixelSize = pMonitor->vecSize; if (pMonitorRule->enable10bit) { @@ -1404,14 +1404,11 @@ bool CHyprRenderer::applyMonitorRule(CMonitor* pMonitor, SMonitorRule* pMonitorR pMonitor->vecPosition = pMonitorRule->offset; } - 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 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);