[haiku-appserver] Re: GetMouse()

  • From: "Stephan Assmus" <superstippi@xxxxxx>
  • To: haiku-appserver@xxxxxxxxxxxxx
  • Date: Thu, 19 May 2005 17:23:47 +0200 CEST

Axel D=F6rfler wrote on Thu, 19 May 2005 16:06:16 +0200 CEST:

> > Oh, one more thing...
> >     owner->fLink->Attach<port=3D5Fid>(owner->fLink->GetReplyPort());
> > needs to go. It's useless.
> 
> The one in GetMouse()=3D3F Sorry, you're wrong - when I remove it, 
> nothing 
> is working anymore, the whole app stands still after that. So much 
> for 
> defensive and robust programming :-/

Yes, the "messaging" is very prone to errors. The problem is most 
likely in the server side part that you have not updated, it might try 
to read the reply port from the "message", and that's where it stalls. 
I have come across a couple of these problems.

> > > It still doesn't work correctly, but this time it's probably the 
> > > app=3D5Fserver's fault, as we only rarely get =3D5FUPDATE=3D5F 
> > > messages.
> >     Well, maybe with the above changes it will.
> 
> Yes, indeed, the coordinate change helped a lot :-)
> It still looks very bad compared to R5 as well as the asynchronous 
> version, but at least it's somewhat working now!

One thing I'm wondering about: How about doing the stuff we now do in 
BView::GetMouse() in BWindow::UpdateIfNeeded()=3F We will need this for 
synchronous BAlerts::Go() too BTW. BView::GetMouse() could then use 
UpdateIfNeeded(). I haven't looked very close at that code, so I might 
be way off here.

> BTW: in asynchronous mode, when you press the mouse button over the 
> button (playground app), and then release it somewhere else, the 
> button 
> still changes its status on mouse over (without a button pressed).
> This doesn't happen under R5, so I guess our event mask stuff is not 
> yet working correctly.

Yep, that's exactly the problem. IMHO, we need to fix this too before 
an official demo. Somewhere, someone needs to maintain a list of all 
targets wanting mouse or keyboard events, as per the 
BView::SetEventMask() (from anywhere) and BView::SetMouseEventMask() 
(only from MouseDown and automatically reverted after MouseUp) methods. 
This someone probably needs to be the app=5Fserver, since the targets 
could be in multiple windows across different apps. It would then be 
easy to change the mouse coords to arrive in view space, while we're 
working on this anyways.

If someone wants to look into this, please drop a line, so that we 
don't duplicate efforts. I was going to look into drawing BBitmaps 
first. Mouse events are sent in the RootLayer::MouseEventHandler() code 
BTW.

Best regards,
-Stephan


Other related posts: