From fc91c7b92d69a8bb7ae09bd71b879f88efa881a3 Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Tue, 19 Nov 2024 16:31:55 -0700 Subject: [PATCH] prevent canvas piano roll header scroomer drag pushing the same cursor over and over --- gtk2_ardour/prh.cc | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/gtk2_ardour/prh.cc b/gtk2_ardour/prh.cc index 1b3164c88e..8592ec3f97 100644 --- a/gtk2_ardour/prh.cc +++ b/gtk2_ardour/prh.cc @@ -636,14 +636,20 @@ PianoRollHeader::motion_handler (GdkEventMotion* ev) double edge = 5. * UIConfiguration::instance().get_ui_scale(); if (evd.y > scroomer_top - 5 && evd.y < scroomer_top + edge){ - _view->editing_context().push_canvas_cursor (_view->editing_context().cursors()->resize_top); - _scroomer_state = TOP; + if (_scroomer_state != TOP) { + _view->editing_context().push_canvas_cursor (_view->editing_context().cursors()->resize_top); + _scroomer_state = TOP; + } } else if (evd.y > scroomer_bottom - edge && evd.y < scroomer_bottom + edge){ - _view->editing_context().push_canvas_cursor (_view->editing_context().cursors()->resize_bottom); - _scroomer_state = BOTTOM; + if (_scroomer_state != BOTTOM) { + _view->editing_context().push_canvas_cursor (_view->editing_context().cursors()->resize_bottom); + _scroomer_state = BOTTOM; + } } else { - _view->editing_context().push_canvas_cursor (_view->editing_context().cursors()->grabber); - _scroomer_state = MOVE; + if (_scroomer_state != MOVE) { + _view->editing_context().push_canvas_cursor (_view->editing_context().cursors()->grabber); + _scroomer_state = MOVE; + } } }