The last change accidently put messages to invalid targets back into the game.

_DetermineTarget() is no longer called for these messages, "handler" will stay
NULL and the message will be dropped.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15921 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Axel Dörfler 2006-01-11 22:38:43 +00:00
parent 54354618d5
commit 238ba7d321
1 changed files with 7 additions and 7 deletions

View File

@ -2284,13 +2284,11 @@ BWindow::task_looper()
// dispatch loop.
dispatchNextMessage = false;
} else {
// Get the target handler
BHandler *handler = NULL;
// Use the private BMessage accessor to determine if we are
// using the preferred handler, or if a target has been
// specified
// Get the target handler
BMessage::Private messagePrivate(fLastMessage);
bool usePreferred = messagePrivate.UsePreferredTarget();
BHandler *handler = NULL;
bool dropMessage = false;
if (usePreferred) {
handler = PreferredHandler();
@ -2301,11 +2299,13 @@ BWindow::task_looper()
B_HANDLER_TOKEN, (void **)&handler);
// if this handler doesn't belong to us, we drop the message
if (handler != NULL && handler->Looper() != this)
if (handler != NULL && handler->Looper() != this) {
dropMessage = true;
handler = NULL;
}
}
if (handler == NULL || usePreferred)
if ((handler == NULL && !dropMessage) || usePreferred)
handler = _DetermineTarget(fLastMessage, handler);
unpack_cookie cookie;