summaryrefslogtreecommitdiff
path: root/gtk2_ardour/editor.cc
diff options
context:
space:
mode:
authorPaul Davis <paul@linuxaudiosystems.com>2014-06-09 10:02:38 -0400
committerPaul Davis <paul@linuxaudiosystems.com>2014-06-09 10:02:38 -0400
commitd36afa6b8bb3815d91e0fe93887a83e4a873f157 (patch)
tree9df715b20721ea3f0d005b0bfccd05ed611c63ef /gtk2_ardour/editor.cc
parent95f2b4ba17949ef5d70bc973665e1b9c29f38e4d (diff)
forward scroll events from track control headers to the canvas, to get consistent scroll behaviour (whatever that behaviour is)
Diffstat (limited to 'gtk2_ardour/editor.cc')
-rw-r--r--gtk2_ardour/editor.cc32
1 files changed, 9 insertions, 23 deletions
diff --git a/gtk2_ardour/editor.cc b/gtk2_ardour/editor.cc
index d63484c899..13f851a8c7 100644
--- a/gtk2_ardour/editor.cc
+++ b/gtk2_ardour/editor.cc
@@ -495,11 +495,9 @@ Editor::Editor ()
controls_layout.add (*h);
controls_layout.set_name ("EditControlsBase");
- controls_layout.add_events (Gdk::SCROLL_MASK);
- controls_layout.signal_scroll_event().connect (sigc::mem_fun(*this, &Editor::control_layout_scroll), false);
-
- controls_layout.add_events (Gdk::BUTTON_PRESS_MASK|Gdk::BUTTON_RELEASE_MASK|Gdk::ENTER_NOTIFY_MASK|Gdk::LEAVE_NOTIFY_MASK);
+ controls_layout.add_events (Gdk::BUTTON_PRESS_MASK|Gdk::BUTTON_RELEASE_MASK|Gdk::ENTER_NOTIFY_MASK|Gdk::LEAVE_NOTIFY_MASK|Gdk::SCROLL_MASK);
controls_layout.signal_button_release_event().connect (sigc::mem_fun(*this, &Editor::edit_controls_button_release));
+ controls_layout.signal_scroll_event().connect (sigc::mem_fun(*this, &Editor::control_layout_scroll), false);
_cursors = new MouseCursors;
@@ -3878,26 +3876,14 @@ Editor::transport_punch_location()
bool
Editor::control_layout_scroll (GdkEventScroll* ev)
{
- if (Keyboard::some_magic_widget_has_focus()) {
- return false;
- }
-
- switch (ev->direction) {
- case GDK_SCROLL_UP:
- scroll_tracks_up_line ();
- return true;
- break;
+ /* Just forward to the normal canvas scroll method. The coordinate
+ systems are different but since the canvas is always larger than the
+ track headers, and aligned with the trackview area, this will work.
- case GDK_SCROLL_DOWN:
- scroll_tracks_down_line ();
- return true;
-
- default:
- /* no left/right handling yet */
- break;
- }
-
- return false;
+ In the not too distant future this layout is going away anyway and
+ headers will be on the canvas.
+ */
+ return canvas_scroll_event (ev);
}
void