diff --git a/Track.C b/Track.C index 4c8947f..1212803 100644 --- a/Track.C +++ b/Track.C @@ -191,12 +191,30 @@ int Track::handle ( int m ) { static Track_Widget *pushed; + static Track_Widget *belowmouse; switch ( m ) { - case FL_MOVE: - /* these aren't used, so don't bother doing lookups for them */ + case FL_ENTER: + case FL_LEAVE: return 1; + case FL_MOVE: + { + /* these aren't used, so don't bother doing lookups for them */ + Track_Widget *r = event_widget(); + + if ( r != belowmouse ) + { + if ( belowmouse ) + belowmouse->handle( FL_LEAVE ); + belowmouse = r; + + if ( r ) + r->handle( FL_ENTER ); + } + + return 1; + } default: { Track_Widget *r = pushed ? pushed : event_widget(); @@ -216,9 +234,19 @@ Track::handle ( int m ) while ( _delete_queue.size() ) { - delete _delete_queue.front(); + Track_Widget *t = _delete_queue.front(); _delete_queue.pop(); - pushed = NULL; + + + if ( pushed == t ) + pushed = NULL; + if ( belowmouse == t ) + { + belowmouse->handle( FL_LEAVE ); + belowmouse = NULL; + } + + delete t; } Loggable::block_end(); diff --git a/Track_Widget.C b/Track_Widget.C index 682a75d..c40be07 100644 --- a/Track_Widget.C +++ b/Track_Widget.C @@ -107,9 +107,6 @@ Track_Widget::dispatch ( int m ) int Track_Widget::handle ( int m ) { -/* static int ox, oy; */ -/* static bool dragging = false; */ - int X = Fl::event_x(); int Y = Fl::event_y(); @@ -146,7 +143,7 @@ Track_Widget::handle ( int m ) _drag = NULL; } - fl_cursor( FL_CURSOR_DEFAULT ); + fl_cursor( FL_CURSOR_HAND ); return 1; case FL_DRAG: {