diff options
author | Robin Gareus <robin@gareus.org> | 2017-11-29 12:04:19 +0100 |
---|---|---|
committer | Robin Gareus <robin@gareus.org> | 2017-11-29 12:06:42 +0100 |
commit | d1183770de7a776ee67ecc224965bd236f92d2df (patch) | |
tree | 812471edf1c1f99a9cb4c94cd87b83640f9bca17 /libs/widgets | |
parent | 5fd723b1f000da658ee13ae2cf79a0636a2bc0f2 (diff) |
ArdourButton: ignore double+tripple clicks
Diffstat (limited to 'libs/widgets')
-rw-r--r-- | libs/widgets/ardour_button.cc | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/libs/widgets/ardour_button.cc b/libs/widgets/ardour_button.cc index ebd23b2aac..d359879449 100644 --- a/libs/widgets/ardour_button.cc +++ b/libs/widgets/ardour_button.cc @@ -853,6 +853,10 @@ ArdourButton::on_button_press_event (GdkEventButton *ev) { focus_handler (this); + if (ev->type == GDK_2BUTTON_PRESS || ev->type == GDK_3BUTTON_PRESS) { + return _fallthrough_to_parent ? false : true; + } + 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 && ev->y >= _led_rect->y && ev->y < _led_rect->y + _led_rect->height) { @@ -874,15 +878,15 @@ ArdourButton::on_button_press_event (GdkEventButton *ev) } } - if (_fallthrough_to_parent) - return false; - - return true; + return _fallthrough_to_parent ? false : true; } bool ArdourButton::on_button_release_event (GdkEventButton *ev) { + if (ev->type == GDK_2BUTTON_PRESS || ev->type == GDK_3BUTTON_PRESS) { + return _fallthrough_to_parent ? false : true; + } if (ev->button == 1 && _hovering && (_elements & Indicator) && _led_rect && _distinct_led_click) { if (ev->x >= _led_rect->x && ev->x < _led_rect->x + _led_rect->width && ev->y >= _led_rect->y && ev->y < _led_rect->y + _led_rect->height) { @@ -904,10 +908,7 @@ ArdourButton::on_button_release_event (GdkEventButton *ev) } } - if (_fallthrough_to_parent) - return false; - - return true; + return _fallthrough_to_parent ? false : true; } void |