+bool
+TimeAxisView::controls_ebox_button_press (GdkEventButton* event)
+{
+ if (maybe_set_cursor (event->y) > 0) {
+ _resize_drag_start = event->y_root;
+ }
+
+ return true;
+}
+
+void
+TimeAxisView::idle_resize (uint32_t h)
+{
+ set_height (h);
+}
+
+
+bool
+TimeAxisView::controls_ebox_motion (GdkEventMotion* ev)
+{
+ if (_resize_drag_start >= 0) {
+ /* (ab)use the DragManager to do autoscrolling; adjust the event coordinates
+ into the world coordinate space that DragManager::motion_handler is expecting,
+ and then fake a DragManager motion event so that when maybe_autoscroll
+ asks DragManager for the current pointer position it will get the correct
+ answers.
+ */
+ int tx, ty;
+ controls_ebox.translate_coordinates (*control_parent, ev->x, ev->y, tx, ty);
+ ev->y = ty - _editor.get_trackview_group_vertical_offset();
+ _editor.drags()->motion_handler ((GdkEvent *) ev, false);
+ _editor.maybe_autoscroll (false, true);
+
+ /* now do the actual TAV resize */
+ int32_t const delta = (int32_t) floor (ev->y_root - _resize_drag_start);
+ _editor.add_to_idle_resize (this, delta);
+ _resize_drag_start = ev->y_root;
+ } else {
+ /* not dragging but ... */
+ Glib::RefPtr<Gdk::Window> win = controls_ebox.get_window();
+
+ maybe_set_cursor (ev->y);
+ }
+
+ return true;
+}
+
+bool
+TimeAxisView::maybe_set_cursor (int y)
+{
+ /* XXX no Gtkmm Gdk::Window::get_cursor() */
+ Glib::RefPtr<Gdk::Window> win = controls_ebox.get_window();
+
+ if (y > (gint) floor (controls_ebox.get_height() * 0.75)) {
+
+ /* y-coordinate in lower 25% */
+
+ if (!_have_preresize_cursor) {
+ _preresize_cursor = gdk_window_get_cursor (win->gobj());
+ _have_preresize_cursor = true;
+ win->set_cursor (Gdk::Cursor(Gdk::SB_V_DOUBLE_ARROW));
+ }
+
+ return 1;
+
+ } else if (_have_preresize_cursor) {
+ gdk_window_set_cursor (win->gobj(), _preresize_cursor);
+ _have_preresize_cursor = false;
+
+ return -1;
+ }
+
+ return 0;
+}
+