13
0

Somewhat distasteful hack to fix #3469 (broken keyboard-entry of pan values)

git-svn-id: svn://localhost/ardour2/branches/3.0@8090 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
Carl Hetherington 2010-11-26 00:29:12 +00:00
parent 54cbc45a5a
commit 1539ac1b96
5 changed files with 33 additions and 1 deletions

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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__ */

View File

@ -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;
}

View File

@ -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;