+ /* Work out the distance between the right hand edge of the trackview and the edge of
+ the monitor that it is on.
+ */
+
+ Glib::RefPtr<Gdk::Window> gdk_window = get_window ();
+ Gdk::Rectangle window_rect;
+ gdk_window->get_frame_extents (window_rect);
+
+ Glib::RefPtr<Gdk::Screen> screen = get_screen ();
+ Gdk::Rectangle root_rect;
+ screen->get_root_window()->get_frame_extents (root_rect);
+
+ Gtk::Allocation editor_list = _the_notebook.get_allocation ();
+
+ framecnt_t distance = pixel_to_frame (root_rect.get_x() + root_rect.get_width() - window_rect.get_x() - window_rect.get_width());
+ if (_the_notebook.is_visible ()) {
+ distance += pixel_to_frame (editor_list.get_width());
+ }
+
+ /* Note whether we're fudging the autoscroll (see autoscroll_fudge_threshold) */
+ _autoscroll_fudging = (distance < autoscroll_fudge_threshold ());
+
+ double const ty = _drags->current_pointer_y() - get_trackview_group_vertical_offset ();
+