From d5f127df32592511f1d3eddce0ef194711424319 Mon Sep 17 00:00:00 2001 From: Ilia Bozhinov Date: Fri, 31 Jul 2026 09:38:54 +0200 Subject: [PATCH] output-layout: add support for mirroring resolution Resubmit of #1716 Original work by @TRPB Co-authored-by: Tom Butler --- src/core/output-layout.cpp | 15 ++++++++++++--- subprojects/wf-config | 2 +- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/src/core/output-layout.cpp b/src/core/output-layout.cpp index aa0f9ae06..0c3fea09d 100644 --- a/src/core/output-layout.cpp +++ b/src/core/output-layout.cpp @@ -429,7 +429,10 @@ bool output_state_t::operator ==(const output_state_t& other) const if (source == OUTPUT_IMAGE_SOURCE_MIRROR) { return other.source == OUTPUT_IMAGE_SOURCE_MIRROR && - mirror_from == other.mirror_from; + mirror_from == other.mirror_from && + (mode.width == other.mode.width) && + (mode.height == other.mode.height) && + (mode.refresh == other.mode.refresh); } bool eq = true; @@ -758,7 +761,11 @@ struct output_layout_output_t case output_config::MODE_MIRROR: state.source = OUTPUT_IMAGE_SOURCE_MIRROR; - state.mode = select_default_mode(output_config::MODE_AUTO); + tmp.width = mode.get_width(); + tmp.height = mode.get_height(); + tmp.refresh = mode.get_refresh(); + state.mode = ((tmp.width > 0) && is_mode_supported(tmp)) ? + tmp : select_default_mode(output_config::MODE_AUTO); state.mirror_from = mode.get_mirror_from(); break; } @@ -1768,7 +1775,9 @@ class output_layout_t::impl LOGC(OUTPUT, "\t mode: dpms"); } else if (entry.second.source == OUTPUT_IMAGE_SOURCE_MIRROR) { - LOGC(OUTPUT, "\t mode: mirror ", entry.second.mirror_from); + LOGC(OUTPUT, "\t mode: mirror ", entry.second.mirror_from, + " (", entry.second.mode.width, "x", entry.second.mode.height, + "@", entry.second.mode.refresh, ")"); } else { LOGC(OUTPUT, "\t mode: ", diff --git a/subprojects/wf-config b/subprojects/wf-config index c2368a572..add9ba7a4 160000 --- a/subprojects/wf-config +++ b/subprojects/wf-config @@ -1 +1 @@ -Subproject commit c2368a572f0555b93f2d87aae712c9ffa6f25112 +Subproject commit add9ba7a47492d4f86482b0a308d9054a825637e