Fixed a bug causing layer-switch events to not be handled by GAL

This commit is contained in:
Andrew Zonenberg 2015-07-12 21:52:17 -07:00
parent b87ab79d6d
commit 1ad3b05664
1 changed files with 9 additions and 3 deletions

View File

@ -338,9 +338,6 @@ public:
if( !( m_category & aEvent.m_category ) ) if( !( m_category & aEvent.m_category ) )
return false; return false;
if( !( m_actions & aEvent.m_actions ) )
return false;
if( m_category == TC_COMMAND || m_category == TC_MESSAGE ) if( m_category == TC_COMMAND || m_category == TC_MESSAGE )
{ {
if( (bool) m_commandStr && (bool) aEvent.m_commandStr ) if( (bool) m_commandStr && (bool) aEvent.m_commandStr )
@ -349,6 +346,15 @@ public:
if( (bool) m_commandId && (bool) aEvent.m_commandId ) if( (bool) m_commandId && (bool) aEvent.m_commandId )
return *m_commandId == *aEvent.m_commandId; return *m_commandId == *aEvent.m_commandId;
} }
// BUGFIX: TA_ANY should match EVERYTHING, even TA_NONE (for TC_MESSAGE)
if( m_actions == TA_ANY && aEvent.m_actions == TA_NONE && aEvent.m_category == TC_MESSAGE)
return true;
// BUGFIX: This check must happen after the TC_COMMAND check because otherwise events of
// the form { TC_COMMAND, TA_NONE } will be incorrectly skipped
if( !( m_actions & aEvent.m_actions ) )
return false;
return true; return true;
} }