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,7 +402,8 @@ 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();
|
timeline->sequence_lock.wrlock();
|
||||||
add( Sequence_Widget::pushed() );
|
add( Sequence_Widget::pushed() );
|
||||||
timeline->sequence_lock.unlock();
|
timeline->sequence_lock.unlock();
|
||||||
|
@ -407,6 +412,7 @@ Sequence::handle ( int m )
|
||||||
|
|
||||||
fl_cursor( FL_CURSOR_MOVE );
|
fl_cursor( FL_CURSOR_MOVE );
|
||||||
}
|
}
|
||||||
|
}
|
||||||
else
|
else
|
||||||
fl_cursor( FL_CURSOR_DEFAULT );
|
fl_cursor( FL_CURSOR_DEFAULT );
|
||||||
}
|
}
|
||||||
|
@ -446,10 +452,10 @@ Sequence::handle ( int m )
|
||||||
if ( r )
|
if ( r )
|
||||||
r->handle( FL_ENTER );
|
r->handle( FL_ENTER );
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
default:
|
default:
|
||||||
{
|
{
|
||||||
if ( m != FL_DRAG &&
|
if ( m != FL_DRAG &&
|
||||||
|
@ -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() )
|
||||||
|
|
|
@ -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