[haiku-appserver] Re: progress and status

  • From: "Axel Dörfler" <axeld@xxxxxxxxxxxxxxxx>
  • To: haiku-appserver@xxxxxxxxxxxxx
  • Date: Wed, 18 May 2005 13:20:52 +0200 CEST

Adi Oanca <adioanca@xxxxxxxxxxxxxx> wrote:
>       First of all, we need to make sure we are BWindow thread. Second 
> thing, take all message from BWindow's port and put them in the 
> MessageQueue().
>       Then search for B_MOUSE_UP and B_MOUSE_MOVED messages, and 
> while doing so, take the _UPDATE_ message that you may find and 
> dispatch 
> it. Calling DispatchMessage(updateMsg, window) is OK - I don't see 
> any 
> problem by doing so.

I'm pretty sure that calling DispatchMessage() from GetMouse() is a bad 
idea. The first question to ask for me would be: why are you doing 
this?
DispatchMessage() will a) process the messages, and b) call the 
handler's MessageReceived() hooks (hello stack eating recursion, btw). 
That's not what you want in GetMouse() - if checkQueue is true, it 
should just peek at the queue, and remove the oldest message there is.
The idea behind this is (AFAICT) that the Mouse*() hooks are *not* 
called again for these events.
_UPDATE_ messages don't need to go through DispatchMessage() either, we 
just need to make sure they are processed.

>       One thing I don't understand from the current implementation is why
> *location is not updated with the coordinates found in up or moved 
> messages?

You are supposed to call GetMouse() more than once to get the latest 
event.

Bye,
   Axel.


Other related posts: