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;
}
, panning_link_button (_("link"))
, pan_automation_style_button ("")
, pan_automation_state_button ("")
+ , _bar_spinner_active (false)
{
set_session (s);
(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);
_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;
+}
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__ */
darea.show ();
switching = false;
+
+ SpinnerActive (false); /* EMIT SIGNAL */
+
return FALSE;
}
spinner.grab_focus ();
switching = false;
+
+ SpinnerActive (true); /* EMIT SIGNAL */
+
return FALSE;
}
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;