summaryrefslogtreecommitdiff
path: root/gtk2_ardour/editor_mouse.cc
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2014-12-23 13:46:53 -0500
committerDavid Robillard <d@drobilla.net>2014-12-23 13:47:59 -0500
commit62355de33a00e40c20b79d7db1ac2139fd042743 (patch)
tree252d1c251f57f8e5465bbff5a468af31a0da5f37 /gtk2_ardour/editor_mouse.cc
parente00c579fb2e99e993a0ab84ff00ba3109f6b5f20 (diff)
Fix cursor update on nested entry.
For example, if you're in a note and something about the mode changes, it's the underlying region context that needs to change. So, seems we need a stack of entry contexts to deal with this sort of thing. Switching in/out of smart mode still doesn't update immediately because we don't have the y-coordinate needed to update it.
Diffstat (limited to 'gtk2_ardour/editor_mouse.cc')
-rw-r--r--gtk2_ardour/editor_mouse.cc17
1 files changed, 10 insertions, 7 deletions
diff --git a/gtk2_ardour/editor_mouse.cc b/gtk2_ardour/editor_mouse.cc
index a799bf85af..6d73d32cc0 100644
--- a/gtk2_ardour/editor_mouse.cc
+++ b/gtk2_ardour/editor_mouse.cc
@@ -320,6 +320,8 @@ Editor::mouse_mode_toggled (MouseMode m)
update_time_selection_display ();
+ update_all_enter_cursors ();
+
MouseModeChanged (); /* EMIT SIGNAL */
}
@@ -1642,8 +1644,7 @@ Editor::leave_handler (ArdourCanvas::Item* item, GdkEvent*, ItemType item_type)
bool is_start;
bool ret = true;
- _enter_cursor_ctx.reset();
- _entered_item_type = NoItem;
+ _enter_stack.pop_back();
switch (item_type) {
case ControlPointItem:
@@ -2314,9 +2315,10 @@ Editor::update_join_object_range_location (double y)
double const c = item_space.y / entered_regionview->height();
_join_object_range_state = c <= 0.5 ? JOIN_OBJECT_RANGE_RANGE : JOIN_OBJECT_RANGE_OBJECT;
-
- if (_join_object_range_state != old && _enter_cursor_ctx) {
- _enter_cursor_ctx->change(which_track_cursor());
+
+ Editor::EnterContext* ctx = get_enter_context(RegionItem);
+ if (_join_object_range_state != old && ctx) {
+ ctx->cursor_ctx->change(which_track_cursor());
}
} else if (entered_track) {
@@ -2348,8 +2350,9 @@ Editor::update_join_object_range_location (double y)
_join_object_range_state = JOIN_OBJECT_RANGE_OBJECT;
}
- if (_join_object_range_state != old && _enter_cursor_ctx) {
- _enter_cursor_ctx->change(which_track_cursor());
+ Editor::EnterContext* ctx = get_enter_context(StreamItem);
+ if (_join_object_range_state != old && ctx) {
+ ctx->cursor_ctx->change(which_track_cursor());
}
}
}