[haiku-appserver] Re: progress and status

  • From: "Stephan Assmus" <superstippi@xxxxxx>
  • To: haiku-appserver@xxxxxxxxxxxxx
  • Date: Tue, 17 May 2005 21:32:34 +0200 CEST

Hi Adi,

> >>If blocking inside MouseDown(), the messages from the >app_server 
> > > should 
> >>still be appended to the queue, and if this does not happen, >then 
> > > its a 
> >>bug. Do you want to investigate this?
> 
>       That's not a bug, because it's not possible.
>       BWindow thread is in task_looper()->DispatchMessage()->MouseDown() 
> and 
> it's blocked here until MouseDown() returns. What happens is, 
> messages 
> from the server (and other threads) will enqueue in kernel's port 
> queue 
> that BLooper created. (have a look at BLooper::task_looper())

You're right on track with how you understood what the problem is. But 
it might not only be with _UPDATE_ messages, but also with others, such 
as mouse moved ones. (Depending on how BView::GetMouse() works. In some 
cases, it needs to check the queue, as per the flag, and in other not.)

>       You need to have UpdateIfNeeded() working, or what? To implement 
> this 
> method we need to enqueue all messages from BWindow/BLooper's port 
> into 
> BLooper's MessageQueue() and search for _UPDATE_ message. There must 
> be 
> only one! Then simply do exactly what 
> BWindow::DispatchMessage()::case_UPDATE_ does - call Draw() where 
> it's 
> needed. In other words: we take the _UPDATE_ message and process it 
> NOW!
>       (Another approach: put all message for BWindow's port in BLooper's 
> MessageQueue(), search for _UPDATE_ message, pull it out from
> MessageQueue() and call DispatchMessage(updateMsg, Window()); )

You're absolutely right, but the problem is how to pull the messages 
from the port and put them into the message queue while the window 
thread is actually blocked in task_looper()->DispatchMessage()->
MouseDown(). Can this be done?

Hope this clears it up.

Best regards,
-Stephan


Other related posts: