+bool
+TimeAxisView::controls_ebox_button_press (GdkEventButton* event)
+{
+ if ((event->button == 1 && event->type == GDK_2BUTTON_PRESS) || Keyboard::is_edit_event (event)) {
+ /* see if it is inside the name label */
+ if (name_label.is_ancestor (controls_ebox)) {
+ int nlx;
+ int nly;
+ controls_ebox.translate_coordinates (name_label, event->x, event->y, nlx, nly);
+ Gtk::Allocation a = name_label.get_allocation ();
+ if (nlx > 0 && nlx < a.get_width() && nly > 0 && nly < a.get_height()) {
+ begin_name_edit ();
+ _ebox_release_can_act = false;
+ return true;
+ }
+ }
+
+ }
+
+ _ebox_release_can_act = true;
+
+ 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 - basically we
+ * are pretending that the drag is taking place over the canvas
+ * (which perhaps in the glorious future, when track headers
+ * and the canvas are unified, will actually be true.)
+ */
+
+ _editor.maybe_autoscroll (false, true, true);
+
+ /* now schedule 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 ... */
+ maybe_set_cursor (ev->y);
+ }
+
+ gdk_event_request_motions(ev);
+ return true;
+}
+
+bool
+TimeAxisView::controls_ebox_leave (GdkEventCrossing*)
+{
+ if (_have_preresize_cursor) {
+ gdk_window_set_cursor (controls_ebox.get_window()->gobj(), _preresize_cursor);
+ _have_preresize_cursor = false;
+ }
+ 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;
+}
+