Timeline: Fix bug where opening context menu on a region is equivalent to initiating a drag on that region.
Closes #126
This commit is contained in:
parent
d881dce874
commit
9790201fd8
|
@ -841,6 +841,9 @@ Audio_Region::handle ( int m )
|
||||||
}
|
}
|
||||||
case FL_DRAG:
|
case FL_DRAG:
|
||||||
|
|
||||||
|
if ( Fl::event_is_click() )
|
||||||
|
return 1;
|
||||||
|
|
||||||
if ( ! _drag )
|
if ( ! _drag )
|
||||||
{
|
{
|
||||||
begin_drag( Drag( X, Y, x_to_offset( X ) ) );
|
begin_drag( Drag( X, Y, x_to_offset( X ) ) );
|
||||||
|
|
|
@ -321,6 +321,10 @@ Sequence::handle ( int m )
|
||||||
/* if ( m != FL_NO_EVENT ) */
|
/* if ( m != FL_NO_EVENT ) */
|
||||||
/* DMESSAGE( "%s", event_name( m ) ); */
|
/* DMESSAGE( "%s", event_name( m ) ); */
|
||||||
|
|
||||||
|
// if ( m == FL_RELEASE )
|
||||||
|
if ( ! Fl::pushed() )
|
||||||
|
Sequence_Widget::pushed( NULL );
|
||||||
|
|
||||||
switch ( m )
|
switch ( m )
|
||||||
{
|
{
|
||||||
case FL_KEYBOARD:
|
case FL_KEYBOARD:
|
||||||
|
@ -398,14 +402,16 @@ Sequence::handle ( int m )
|
||||||
if ( Sequence_Widget::pushed()->sequence()->class_name() == class_name() )
|
if ( Sequence_Widget::pushed()->sequence()->class_name() == class_name() )
|
||||||
{
|
{
|
||||||
/* accept objects dragged from other sequences of this type */
|
/* accept objects dragged from other sequences of this type */
|
||||||
|
if ( Sequence_Widget::pushed()->sequence() != this )
|
||||||
timeline->sequence_lock.wrlock();
|
{
|
||||||
add( Sequence_Widget::pushed() );
|
timeline->sequence_lock.wrlock();
|
||||||
timeline->sequence_lock.unlock();
|
add( Sequence_Widget::pushed() );
|
||||||
|
timeline->sequence_lock.unlock();
|
||||||
damage( FL_DAMAGE_USER1 );
|
|
||||||
|
damage( FL_DAMAGE_USER1 );
|
||||||
fl_cursor( FL_CURSOR_MOVE );
|
|
||||||
|
fl_cursor( FL_CURSOR_MOVE );
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
fl_cursor( FL_CURSOR_DEFAULT );
|
fl_cursor( FL_CURSOR_DEFAULT );
|
||||||
|
@ -446,9 +452,9 @@ Sequence::handle ( int m )
|
||||||
if ( r )
|
if ( r )
|
||||||
r->handle( FL_ENTER );
|
r->handle( FL_ENTER );
|
||||||
}
|
}
|
||||||
|
|
||||||
return 1;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return 1;
|
||||||
}
|
}
|
||||||
default:
|
default:
|
||||||
{
|
{
|
||||||
|
@ -462,6 +468,9 @@ Sequence::handle ( int m )
|
||||||
/* if ( this == Fl::focus() ) */
|
/* if ( this == Fl::focus() ) */
|
||||||
/* DMESSAGE( "Sequence widget = %p", r ); */
|
/* DMESSAGE( "Sequence widget = %p", r ); */
|
||||||
|
|
||||||
|
if ( m == FL_RELEASE )
|
||||||
|
Sequence_Widget::pushed( NULL );
|
||||||
|
|
||||||
if ( r )
|
if ( r )
|
||||||
{
|
{
|
||||||
int retval = r->dispatch( m );
|
int retval = r->dispatch( m );
|
||||||
|
@ -482,8 +491,6 @@ Sequence::handle ( int m )
|
||||||
|
|
||||||
r->handle( FL_FOCUS );
|
r->handle( FL_FOCUS );
|
||||||
}
|
}
|
||||||
else if ( m == FL_RELEASE )
|
|
||||||
Sequence_Widget::pushed( NULL );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( _delete_queue.size() )
|
if ( _delete_queue.size() )
|
||||||
|
@ -508,7 +515,7 @@ Sequence::handle ( int m )
|
||||||
timeline->sequence_lock.unlock();
|
timeline->sequence_lock.unlock();
|
||||||
}
|
}
|
||||||
|
|
||||||
Loggable::block_end();
|
Loggable::block_end();
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( m == FL_PUSH )
|
if ( m == FL_PUSH )
|
||||||
|
|
|
@ -1137,7 +1137,7 @@ Track::handle ( int m )
|
||||||
timeline->insert_track( this, timeline->event_inside() );
|
timeline->insert_track( this, timeline->event_inside() );
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
return 0;
|
return Fl_Group::handle( m );
|
||||||
break;
|
break;
|
||||||
case FL_DND_RELEASE:
|
case FL_DND_RELEASE:
|
||||||
receptive_to_drop = 0;
|
receptive_to_drop = 0;
|
||||||
|
|
Loading…
Reference in New Issue