[interfacekit] Re: BHandler::StopWatchingAll()

On Mon, 21 Oct 2002, Axel =?iso-8859-1?q?D=F6rfler ?= wrote:

>
> Another issue with the BHandler observer stuff.
> BHandler::StopWatchingAll() isn't correctly implemented in BeOS; it
> will just remove the notification state -1.
> OTOH StartWatchingAll() will just add the notification state -1.
>
> I would remove all states and replace them with -1 for
> StartWatchingAll(), and always remove anything for StopWatchingAll() -
> the BeBook states this functionality:
> -----
> StartWatchingAll()
> registers the specified BMessenger or BHandler to be notified when any
> of the
> notifer's states change.
>
> StopWatchingAll(), by
> some odd coincidence, stops all monitoring by the BHandler or
> BMessenger
> specified by watcher.
> -----
>
> They even make jokes when the function doesn't do what it should ;)
>
> I just changed the Tracker sources to the correct usage of the
> notification model, and also replaced calls to StopWatchingAll() by
> calls to remove every single notification to get this right - and it *
> still* works... (I really have no idea what made the old version work).

I was planning to do some research on this, but now that it is changed, I
guess I can't keep the motivation. ;-)
BTW, my only explanation for why it worked before is, that there is there
is some other mechanism in the Tracker, that causes the notifcation
messages to be sent to/to arrive at the correct targets. Maybe it's still
worthwhile to do some research on this matter...

Anyway, thanks for the fix. I guess, that will fix the problem with the
flooded app looper port, as the 'OBST' messages will be sent to the
windows now.

CU, Ingo


Other related posts: