ignore mouse-scroll if scroll-bar is not present.

fixes http://tracker.ardour.org/view.php?id=5557
This commit is contained in:
Robin Gareus 2013-07-13 14:58:23 +02:00
parent 5bae4373c7
commit cb9b1801ec
2 changed files with 4 additions and 0 deletions

View File

@ -309,6 +309,7 @@ Meterbridge::on_scroll_event (GdkEventScroll* ev)
void
Meterbridge::scroll_left ()
{
if (!scroller.get_hscrollbar()) return;
Adjustment* adj = scroller.get_hscrollbar()->get_adjustment();
/* stupid GTK: can't rely on clamping across versions */
scroller.get_hscrollbar()->set_value (max (adj->get_lower(), adj->get_value() - adj->get_step_increment()));
@ -317,6 +318,7 @@ Meterbridge::scroll_left ()
void
Meterbridge::scroll_right ()
{
if (!scroller.get_hscrollbar()) return;
Adjustment* adj = scroller.get_hscrollbar()->get_adjustment();
/* stupid GTK: can't rely on clamping across versions */
scroller.get_hscrollbar()->set_value (min (adj->get_upper(), adj->get_value() + adj->get_step_increment()));

View File

@ -1666,6 +1666,7 @@ Mixer_UI::pane_allocation_handler (Allocation&, Gtk::Paned* which)
void
Mixer_UI::scroll_left ()
{
if (!scroller.get_hscrollbar()) return;
Adjustment* adj = scroller.get_hscrollbar()->get_adjustment();
/* stupid GTK: can't rely on clamping across versions */
scroller.get_hscrollbar()->set_value (max (adj->get_lower(), adj->get_value() - adj->get_step_increment()));
@ -1674,6 +1675,7 @@ Mixer_UI::scroll_left ()
void
Mixer_UI::scroll_right ()
{
if (!scroller.get_hscrollbar()) return;
Adjustment* adj = scroller.get_hscrollbar()->get_adjustment();
/* stupid GTK: can't rely on clamping across versions */
scroller.get_hscrollbar()->set_value (min (adj->get_upper(), adj->get_value() + adj->get_step_increment()));