From a564be73c5639fd596b52e2f9956b05f4a8e967a Mon Sep 17 00:00:00 2001 From: vaxerski Date: Wed, 10 Aug 2022 13:31:58 +0200 Subject: [PATCH] set correct full params in disabled at launch --- src/helpers/Monitor.cpp | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/src/helpers/Monitor.cpp b/src/helpers/Monitor.cpp index ac4435b2..b4d6d395 100644 --- a/src/helpers/Monitor.cpp +++ b/src/helpers/Monitor.cpp @@ -14,9 +14,35 @@ void CMonitor::onConnect(bool noRule) { // if it's disabled, disable and ignore if (monitorRule.disabled) { + + wlr_output_enable_adaptive_sync(output, 1); + wlr_output_set_scale(output, 1); + wlr_output_set_transform(output, WL_OUTPUT_TRANSFORM_NORMAL); + + auto PREFSTATE = wlr_output_preferred_mode(output); + + if (!PREFSTATE) { + wlr_output_mode* mode; + + wl_list_for_each(mode, &output->modes, link) { + wlr_output_set_mode(output, PREFSTATE); + + if (!wlr_output_test(output)) + continue; + + PREFSTATE = mode; + break; + } + } + + if (PREFSTATE) + wlr_output_set_mode(output, PREFSTATE); + wlr_output_enable(output, 0); wlr_output_commit(output); + m_bEnabled = false; + hyprListener_monitorFrame.removeCallback(); return; }