libnui / nui3

libnui v3

Home Page:http://libnui.net

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

nuiEvent issue

Jaydee2190 opened this issue · comments

Cancel() in nuiEvent sets mCancel = false;

However to actually stop propogating events this should be true.

bool nuiEventSource::SendEvent(const nuiEvent& rEvent)
{
if (IsEnabled() && !mpTargets.empty())
{
rEvent.SetSource(this);
std::vector<nuiEventTargetBase*> targets(mpTargets);
std::vector<nuiEventTargetBase*>::const_iterator it = targets.begin();
std::vector<nuiEventTargetBase*>::const_iterator end = targets.end();

bool handled = false;
while (it != end && !handled)
{
  ((*it)->OnEvent(rEvent));
  handled = rEvent.IsCanceled(); // returns FALSE when actually cancelled
  ++it;
}

return handled;

}

return false;
}

Indeed, you're right. Thanks for catching it!

closed by 8220731
fixes nuiEvent::Cancel not actually cancelling the event :/
Thanks to Jaydee for finding this bug.