From 324245d029b5afea1e06b0ab313f5f2ec7df1b61 Mon Sep 17 00:00:00 2001 From: Norman Feske Date: Tue, 29 Oct 2024 15:39:12 +0100 Subject: [PATCH] sculpt: restrict un-merging of fb connectors In setups with 3 or more displays, allow the un-merging of connectors only for the last mirrored connector. Otherwise, the operation would implicitely change the order of connectors because the new discrete connector needs appear after all merged connectors. Issue #5286 --- repos/gems/src/app/sculpt_manager/view/fb_widget.h | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/repos/gems/src/app/sculpt_manager/view/fb_widget.h b/repos/gems/src/app/sculpt_manager/view/fb_widget.h index 5ecde73be2..cf957533e3 100644 --- a/repos/gems/src/app/sculpt_manager/view/fb_widget.h +++ b/repos/gems/src/app/sculpt_manager/view/fb_widget.h @@ -117,12 +117,21 @@ struct Sculpt::Fb_widget : Widget s.sub_scope([&] (Scope &s) { s.sub_scope(id, [&] (Scope &s) { - s.sub_scope(Id { "equal" }, [&] (Scope &s) { + + /* + * Restrict merge/unmerge toggle to last merged and first + * discrete connector. + */ + bool const toggle_allowed = (count == num_merged || count == num_merged + 1); + Id const equal_id { toggle_allowed ? "equal" : "_equal" }; + + s.sub_scope(equal_id, + [&] (Scope &s) { s.sub_scope