If a handler passes a BMessage on to the next handler, it will now make sure

its filters are taken into account.
It will also filter out messages in case the filter targeted the current handler
again - note, this is not really a good solution, as ideally, all previous handlers
must be ignored.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15061 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Axel Dörfler 2005-11-21 17:02:56 +00:00
parent 14d02d22f6
commit b360ada4bd

View File

@ -318,8 +318,15 @@ BHandler::MessageReceived(BMessage *message)
// ToDo: there is some more work needed here (someone in the know should fill in)!
if (fNextHandler) {
// ToDo: take the handler's message filter into account!
fNextHandler->MessageReceived(message);
// we need to apply the next handler's filters here, too
BHandler* target = Looper()->_HandlerFilter(message, fNextHandler);
if (target != NULL && target != this) {
// TODO: we also need to make sure that "target" is not before
// us in the handler chain - at least in case it wasn't before
// the handler actually targeted with this message - this could
// get ugly, though.
target->MessageReceived(message);
}
} else if (message->what != B_MESSAGE_NOT_UNDERSTOOD
&& (message->WasDropped() || message->HasSpecifiers())) {
printf("BHandler::MessageReceived(): B_MESSAGE_NOT_UNDERSTOOD");