From 9a11e3a64d485f2e9ae2bb2dd6409eb1c87f99d0 Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Tue, 15 Mar 2016 12:34:26 -0400 Subject: change API for CairoWidget::focus_handler This functor/closure is responsible for stealing focus from any existing text entry (or whatever else may have focus) when clicking on a CairoWidget or derived class. The old implementation just gave focus back to the editor canvas. The new version walks up the widget packing heirarchy to find a focusable parent (from the CairoWidget for which it is invoked). If no focusable parent is found, it cancels keyboard focus in the toplevel window containing the CairoWidget --- gtk2_ardour/ardour_button.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'gtk2_ardour/ardour_button.cc') diff --git a/gtk2_ardour/ardour_button.cc b/gtk2_ardour/ardour_button.cc index a4f346a040..2d020595ab 100644 --- a/gtk2_ardour/ardour_button.cc +++ b/gtk2_ardour/ardour_button.cc @@ -724,7 +724,7 @@ ArdourButton::set_led_left (bool yn) bool ArdourButton::on_button_press_event (GdkEventButton *ev) { - focus_handler (); + focus_handler (this); if (ev->button == 1 && (_elements & Indicator) && _led_rect && _distinct_led_click) { if (ev->x >= _led_rect->x && ev->x < _led_rect->x + _led_rect->width && -- cgit v1.2.3