From 58a700e96878ee5ea61388320c594addb4641bf2 Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Mon, 11 Jul 2011 12:57:17 +0000 Subject: [PATCH] Change the cursor back from the track resize handle when git-svn-id: svn://localhost/ardour2/branches/3.0@9837 d708f5d6-7413-0410-9779-e7cbd77b26cf --- gtk2_ardour/time_axis_view.cc | 13 +++++++++++-- gtk2_ardour/time_axis_view.h | 1 + 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/gtk2_ardour/time_axis_view.cc b/gtk2_ardour/time_axis_view.cc index a37a6ac9d0..85535ca82d 100644 --- a/gtk2_ardour/time_axis_view.cc +++ b/gtk2_ardour/time_axis_view.cc @@ -163,6 +163,7 @@ TimeAxisView::TimeAxisView (ARDOUR::Session* sess, PublicEditor& ed, TimeAxisVie controls_ebox.signal_button_press_event().connect (sigc::mem_fun (*this, &TimeAxisView::controls_ebox_button_press)); controls_ebox.signal_button_release_event().connect (sigc::mem_fun (*this, &TimeAxisView::controls_ebox_button_release)); controls_ebox.signal_motion_notify_event().connect (sigc::mem_fun (*this, &TimeAxisView::controls_ebox_motion)); + controls_ebox.signal_leave_notify_event().connect (sigc::mem_fun (*this, &TimeAxisView::controls_ebox_leave)); controls_ebox.show (); controls_hbox.pack_start (controls_ebox, true, true); @@ -389,14 +390,22 @@ TimeAxisView::controls_ebox_motion (GdkEventMotion* ev) _resize_drag_start = ev->y_root; } else { /* not dragging but ... */ - Glib::RefPtr win = controls_ebox.get_window(); - maybe_set_cursor (ev->y); } return true; } +bool +TimeAxisView::controls_ebox_leave (GdkEventCrossing* ev) +{ + 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) { diff --git a/gtk2_ardour/time_axis_view.h b/gtk2_ardour/time_axis_view.h index 8a354abcd2..efdb2606ed 100644 --- a/gtk2_ardour/time_axis_view.h +++ b/gtk2_ardour/time_axis_view.h @@ -239,6 +239,7 @@ class TimeAxisView : public virtual AxisView virtual bool controls_ebox_scroll (GdkEventScroll*); virtual bool controls_ebox_button_press (GdkEventButton*); virtual bool controls_ebox_motion (GdkEventMotion*); + virtual bool controls_ebox_leave (GdkEventCrossing*); /** Display the standard LHS control menu at when. *