From 53d592b836a649e0312c46a5946b35cf007bf49f Mon Sep 17 00:00:00 2001
From: Colin Fletcher <colin.m.fletcher@googlemail.com>
Date: Sat, 23 Jul 2022 15:43:33 +0100
Subject: [PATCH 2/2] gtk2_ardour: disable "reset to default" on shift-click
 for grouped routes

If a fader of a grouped route is shift-clicked, set its NoResetDefault
tweak bit so that shift only has the effect of "override group". If the
route is not part of a group, ensure the tweak bit is cleared.
---
 gtk2_ardour/gain_meter.cc | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/gtk2_ardour/gain_meter.cc b/gtk2_ardour/gain_meter.cc
index 5e101dac77..d4f18de777 100644
--- a/gtk2_ardour/gain_meter.cc
+++ b/gtk2_ardour/gain_meter.cc
@@ -584,6 +584,12 @@ GainMeterBase::fader_moved ()
 		}
 
 		if (Keyboard::the_keyboard().modifier_state() == Keyboard::group_override_modifier ()) {
+			ArdourFader::Tweaks tweaks = gain_slider->tweaks();
+			if (_route->route_group())
+				gain_slider->set_tweaks (ArdourFader::Tweaks(tweaks | ArdourFader::NoResetDefault));
+			else
+				gain_slider->set_tweaks (ArdourFader::Tweaks(tweaks & ~ArdourFader::NoResetDefault));
+
 			if (Config->get_group_override_inverts ()) {
 				_control->set_value (value, Controllable::InverseGroup);
 			} else {
-- 
2.30.2

