x-fade uses cairo-generated icons, remove XPM
[ardour.git] / gtk2_ardour / editor_mouse.cc
index 9bd882933b43682e3fd2dec3c7d9bbda1eeadc2c..2798ba4a3c7b0063f641788d6ead19231726e5e6 100644 (file)
@@ -237,8 +237,8 @@ Editor::snap_mode_button_clicked (GdkEventButton* ev)
 
 
 
-static Glib::RefPtr<Action>
-get_mouse_mode_action(MouseMode m)
+Glib::RefPtr<Action>
+Editor::get_mouse_mode_action(MouseMode m) const
 {
        switch (m) {
        case MouseRange:
@@ -2106,17 +2106,17 @@ Editor::motion_handler (ArdourCanvas::Item* /*item*/, GdkEvent* event, bool from
 
        update_join_object_range_location (event->motion.y);
 
-       /* snapped_cursor stuff (the snapped_cursor shows where an operation is going to occur) */
-       bool ignored;
-       MusicSample where (0, 0);
-       if (mouse_sample (where.sample, ignored)) {
-               snap_to_with_modifier (where, event);
-               set_snapped_cursor_position (where.sample);
-       }
-
-       /* drags might also change the snapped_cursor location, because we are snapping the thing being dragged, not the actual mouse cursor */
        if (_drags->active ()) {
+               //drags change the snapped_cursor location, because we are snapping the thing being dragged, not the actual mouse cursor
                return _drags->motion_handler (event, from_autoscroll);
+       } else {
+               //the snapped_cursor shows where an operation (like Split) is going to occur
+               bool ignored;
+               MusicSample where (0, 0);
+               if (mouse_sample (where.sample, ignored)) {
+                       snap_to_with_modifier (where, event);
+                       set_snapped_cursor_position (where.sample);
+               }
        }
 
        return false;
@@ -2562,7 +2562,7 @@ Editor::escape ()
 {
        if (_drags->active ()) {
                _drags->abort ();
-       } else {
+       } else if (_session) {
                selection->clear ();
 
                /* if session is playing a range, cancel that */