[haiku-development] Re: weird messaging behaviour

  • From: "Axel Dörfler" <axeld@xxxxxxxxxxxxxxxx>
  • To: haiku-development@xxxxxxxxxxxxx
  • Date: Mon, 02 Nov 2009 11:12:24 +0100

Stefano Ceccherini <stefano.ceccherini@xxxxxxxxx> wrote:
> Is it normal that a message sent to a specific BHandler attached to a
> BLooper is received by the BLooper itself ?

When you have a look to BHandler::MessageReceived(), you will notice 
that it indeeds forwards all messages to the next handler in the queue. 
This could be the parent view in a window, for example.
By default, the looper is set as the next handler for all of its 
handlers. If you do not want this behaviour, you would have to call 
SetNextHandler(NULL) on your handler explicitly.

> I added a test which shows this particular "problem". It's in
> src/tests/kits/app/messaging and it's called HandlerLooperMessageTest.

I guess that isn't really needed.

Bye,
   Axel.


Other related posts: