TOOL_EVENTs of "message" type are passed to all tools

Message type is a kind of notification, so it should be received by all
interested tools. It used to be like that in the past, but has been
broken recently.
This commit is contained in:
Maciej Suminski 2017-01-25 11:31:55 +01:00
parent 0b6147ed05
commit 5d9190038f
1 changed files with 4 additions and 3 deletions

View File

@ -531,7 +531,7 @@ void TOOL_MANAGER::dispatchInternal( const TOOL_EVENT& aEvent )
for( TOOL_STATE* st : ( m_toolState | boost::adaptors::map_values ) )
{
bool handled = false;
bool finished = false;
// no state handler in progress - check if there are any transitions (defined by
// Go() method that match the event.
@ -558,7 +558,8 @@ void TOOL_MANAGER::dispatchInternal( const TOOL_EVENT& aEvent )
if( !st->cofunc->Running() )
finishTool( st ); // The couroutine has finished immediately?
handled = true;
// if it is a message, continue processing
finished = !( aEvent.Category() == TC_MESSAGE );
// there is no point in further checking, as transitions got cleared
break;
@ -566,7 +567,7 @@ void TOOL_MANAGER::dispatchInternal( const TOOL_EVENT& aEvent )
}
}
if( handled )
if( finished )
break; // only the first tool gets the event
}
}