summaryrefslogtreecommitdiff
path: root/gtk2_ardour
diff options
context:
space:
mode:
authorPaul Davis <paul@linuxaudiosystems.com>2014-03-06 10:40:31 -0500
committerPaul Davis <paul@linuxaudiosystems.com>2014-03-06 10:40:31 -0500
commit7d17db09acf5d1090e3c49b58a840e69086ddcc5 (patch)
treeba4978db9ed430e895d024732d499702f6f2e846 /gtk2_ardour
parent7bb305b8ae318f3a268103384f43f717ec7c4871 (diff)
when in smart mode, context-click on a region item should behave as if in object mode.
Specifically, select the region before displaying the context menu
Diffstat (limited to 'gtk2_ardour')
-rw-r--r--gtk2_ardour/editor_mouse.cc51
1 files changed, 29 insertions, 22 deletions
diff --git a/gtk2_ardour/editor_mouse.cc b/gtk2_ardour/editor_mouse.cc
index 2ac9a25e41..9508b2abf5 100644
--- a/gtk2_ardour/editor_mouse.cc
+++ b/gtk2_ardour/editor_mouse.cc
@@ -623,13 +623,22 @@ Editor::button_selection (ArdourCanvas::Item* /*item*/, GdkEvent* event, ItemTyp
to cut notes or regions.
*/
- if (((mouse_mode != MouseObject) &&
- (mouse_mode != MouseAudition || item_type != RegionItem) &&
- (mouse_mode != MouseTimeFX || item_type != RegionItem) &&
- (mouse_mode != MouseGain) &&
- (mouse_mode != MouseDraw)) ||
+ MouseMode eff_mouse_mode = effective_mouse_mode ();
+
+ if (get_smart_mode() && eff_mouse_mode == MouseRange && event->button.button == 3 && item_type == RegionItem) {
+ /* context clicks are always about object properties, even if
+ we're in range mode within smart mode.
+ */
+ eff_mouse_mode = MouseObject;
+ }
+
+ if (((eff_mouse_mode != MouseObject) &&
+ (eff_mouse_mode != MouseAudition || item_type != RegionItem) &&
+ (eff_mouse_mode != MouseTimeFX || item_type != RegionItem) &&
+ (eff_mouse_mode != MouseGain) &&
+ (eff_mouse_mode != MouseDraw)) ||
((event->type != GDK_BUTTON_PRESS && event->type != GDK_BUTTON_RELEASE) || event->button.button > 3) ||
- (internal_editing() && mouse_mode != MouseTimeFX)) {
+ (internal_editing() && eff_mouse_mode != MouseTimeFX)) {
return;
}
@@ -651,25 +660,23 @@ Editor::button_selection (ArdourCanvas::Item* /*item*/, GdkEvent* event, ItemTyp
switch (item_type) {
case RegionItem:
- if (!get_smart_mode() || (_join_object_range_state != JOIN_OBJECT_RANGE_RANGE)) {
- if (press) {
- if (mouse_mode != MouseRange) {
- set_selected_regionview_from_click (press, op);
- } else {
- /* don't change the selection unless the
- clicked track is not currently selected. if
- so, "collapse" the selection to just this
- track
- */
- if (!selection->selected (clicked_axisview)) {
- set_selected_track_as_side_effect (Selection::Set);
- }
- }
+ if (press) {
+ if (eff_mouse_mode != MouseRange) {
+ set_selected_regionview_from_click (press, op);
} else {
- if (mouse_mode != MouseRange) {
- set_selected_regionview_from_click (press, op);
+ /* don't change the selection unless the
+ clicked track is not currently selected. if
+ so, "collapse" the selection to just this
+ track
+ */
+ if (!selection->selected (clicked_axisview)) {
+ set_selected_track_as_side_effect (Selection::Set);
}
}
+ } else {
+ if (eff_mouse_mode != MouseRange) {
+ set_selected_regionview_from_click (press, op);
+ }
}
break;