summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gtk2_ardour/mixer_strip.cc11
-rw-r--r--gtk2_ardour/panner_ui.cc8
-rw-r--r--gtk2_ardour/panner_ui.h4
-rw-r--r--libs/gtkmm2ext/barcontroller.cc6
-rw-r--r--libs/gtkmm2ext/gtkmm2ext/barcontroller.h5
5 files changed, 33 insertions, 1 deletions
diff --git a/gtk2_ardour/mixer_strip.cc b/gtk2_ardour/mixer_strip.cc
index f5ed9d8618..dc788dd35e 100644
--- a/gtk2_ardour/mixer_strip.cc
+++ b/gtk2_ardour/mixer_strip.cc
@@ -1912,7 +1912,16 @@ bool
MixerStrip::on_enter_notify_event (GdkEventCrossing*)
{
Keyboard::magic_widget_grab_focus ();
- grab_focus ();
+
+ if (!panners._bar_spinner_active) {
+ /* This next grab_focus() causes a focus-out event to be sent to, amongst
+ * other things, panner BarControllers. When they receive it, they abort
+ * the use of any SpinButton that might be in use to change pan settings.
+ * Hence we have this horrific hack which stops the grab_focus () call
+ * happening if a bar spinner is active.
+ */
+ grab_focus ();
+ }
return false;
}
diff --git a/gtk2_ardour/panner_ui.cc b/gtk2_ardour/panner_ui.cc
index ea9b270bb5..25580f0f51 100644
--- a/gtk2_ardour/panner_ui.cc
+++ b/gtk2_ardour/panner_ui.cc
@@ -58,6 +58,7 @@ PannerUI::PannerUI (Session* s)
, panning_link_button (_("link"))
, pan_automation_style_button ("")
, pan_automation_state_button ("")
+ , _bar_spinner_active (false)
{
set_session (s);
@@ -453,6 +454,7 @@ PannerUI::setup_pan ()
(sigc::bind (sigc::mem_fun(*this, &PannerUI::pan_button_event), (uint32_t) asz));
bc->set_size_request (-1, pan_bar_height);
+ bc->SpinnerActive.connect (sigc::mem_fun (*this, &PannerUI::bar_spinner_activate));
pan_bars.push_back (bc);
pan_bar_packer.pack_start (*bc, false, false);
@@ -921,3 +923,9 @@ PannerUI::connect_to_pan_control (uint32_t i)
_pan_control_connections, invalidator (*this), boost::bind (&PannerUI::pan_value_changed, this, i), gui_context ()
);
}
+
+void
+PannerUI::bar_spinner_activate (bool a)
+{
+ _bar_spinner_active = a;
+}
diff --git a/gtk2_ardour/panner_ui.h b/gtk2_ardour/panner_ui.h
index 0e16d01a64..4c0039a8d3 100644
--- a/gtk2_ardour/panner_ui.h
+++ b/gtk2_ardour/panner_ui.h
@@ -170,6 +170,10 @@ class PannerUI : public Gtk::HBox, public ARDOUR::SessionHandlePtr
void start_touch (boost::weak_ptr<ARDOUR::AutomationControl>);
void stop_touch (boost::weak_ptr<ARDOUR::AutomationControl>);
+
+ void bar_spinner_activate (bool);
+ /** true if any of our PannerBars are currently using a SpinButton to modify value */
+ bool _bar_spinner_active;
};
#endif /* __ardour_gtk_panner_ui_h__ */
diff --git a/libs/gtkmm2ext/barcontroller.cc b/libs/gtkmm2ext/barcontroller.cc
index 75e5d4e7d6..1b8c210fc9 100644
--- a/libs/gtkmm2ext/barcontroller.cc
+++ b/libs/gtkmm2ext/barcontroller.cc
@@ -398,6 +398,9 @@ BarController::switch_to_bar ()
darea.show ();
switching = false;
+
+ SpinnerActive (false); /* EMIT SIGNAL */
+
return FALSE;
}
@@ -421,6 +424,9 @@ BarController::switch_to_spinner ()
spinner.grab_focus ();
switching = false;
+
+ SpinnerActive (true); /* EMIT SIGNAL */
+
return FALSE;
}
diff --git a/libs/gtkmm2ext/gtkmm2ext/barcontroller.h b/libs/gtkmm2ext/gtkmm2ext/barcontroller.h
index f3eb2f41cd..1a0b78dabe 100644
--- a/libs/gtkmm2ext/gtkmm2ext/barcontroller.h
+++ b/libs/gtkmm2ext/gtkmm2ext/barcontroller.h
@@ -61,6 +61,11 @@ class BarController : public Gtk::Frame
boost::shared_ptr<PBD::Controllable> get_controllable() { return binding_proxy.get_controllable(); }
void set_controllable(boost::shared_ptr<PBD::Controllable> c) { binding_proxy.set_controllable(c); }
+ /** Emitted when the adjustment spinner is activated or deactivated;
+ * the parameter is true on activation, false on deactivation.
+ */
+ sigc::signal<void, bool> SpinnerActive;
+
protected:
Gtk::Adjustment& adjustment;
BindingProxy binding_proxy;