Opened 13 years ago

Closed 13 years ago

Last modified 13 years ago

#1714 closed bug (fixed)

Mouse events mostly do not reach BWindow in Mozilla, aswell as drawing messages

Reported by: fyysik Owned by: stippi
Priority: high Milestone: R1
Component: Servers/app_server Version: R1/pre-alpha1
Keywords: Cc: fredrik.holmqvist@…, umccullough
Blocked By: Blocking:
Platform: x86


When running Mozilla browsers in Haiku-OS, mouse is almost unusable. At start mouse don't work, if you reload page with keyboard, it somewhat works, but flacky. I have set printout with printf() statements on whole chain starting from BWindow::DispatchMessage(), through BView's MouseDown/Up/Moved and finishing in Mozilla's own widget message switch.

Observations. 1)Less than 1/4th of messages reaches BWindow::DispatchMessage in best case. But if it happens, all remaining chain is performing properly - those messages triggers BView's hooks and are going to mozilla internals.

2)Similar problem happens with drawing/invalidation chain.

3) Even when mouse "works" in Mozilla, it works only in certain areas of BWindow with misterious shape.

4)Keyboard input works properly.

5)There is problem even with debugging with printf() from Mozilla. It don't work until you put fflush(stdout); after each printf().

Change History (9)

comment:1 by tqh, 13 years ago

Cc: fredrik.holmqvist@… added

comment:2 by umccullough, 13 years ago

Cc: umccullough added

comment:3 by axeld, 13 years ago

Component: - GeneralServers/app_server
Owner: changed from axeld to stippi
Priority: normalhigh

I've investigated this a bit, and it seems like the clipping is computed incorrectly, at least it doesn't match what you see on screen.

Is there something special on how you construct the view hierarchy in Mozilla (apart from naming everything "Child" :-))?

comment:4 by fyysik, 13 years ago

I've investigated this a bit, and it seems like the clipping is computed incorrectly, at least it doesn't match what you see on screen.

I thought about clipping, but it raises question about Haiku's appserver difference - does it submit mousse messages to to clipping region only?

If so, that's weird in general, and also will break, IMHO, compatibility with Set*EventMask() methods.

Now about setting clipping region. In code under our control, like widget code, explicit clipping is set only inside Scroll procedure. Also I tried to use ConstrainClippingRegion(0) to onscreen-views before we send mozilla's internal message to redraw/reflow widget. Didn't help.

But on other side, Mozilla sets clipping (using also BView's method) by it's own quite intensively via our gfx-backend. I can try to put some debug-statements in those gfx-methods, if you can tell me which info can help you in investigations.

Also I can try to play with clipping myself in gfx-backend.

Call to ConstrainClippingRegion is here it is called in each drawing primitive. And it gets info about region to clip from Mozilla's clipping structure which is also set via group of methods in same file, like this one:

comment:5 by fyysik, 13 years ago

axeld, we were right in our suspects about clipping. If I change code in gfx backend to set clipping region always to 0 in ConstrainClippingRegion instead using region provided by Mozilla - mouse starts work. But yeah, as expected, mozilla look is broken in such case. I can try to fix it in Mozilla code, there are some ideas here, but for sure, it is bug of explicit incompatibility with R5 and Dano

comment:6 by stippi, 13 years ago

Fyysik, Axel and I have already found the problem in our app_server, I guess Axel will commit a fix soon. But not all is good yet, since there are definitely some race conditions with regards to clipping in the app_server. For example, I can observe one problem in WonderBrush with regards to ConstrainClippingRegion() in the navigation view (the background sometimes pops up for the split of a second when drawing). Maybe other problems are related to it as well. In any case, please don't "fix" any code in Firefox. It is a good stress test for our app_server, and it needs to handle it. :-)

comment:7 by axeld, 13 years ago

Resolution: fixed
Status: newclosed

I've created a new bug for the clipping problems (#1719). I'm closing this bug as the mouse problems have been fixed in hrev23663.

comment:8 by fyysik, 13 years ago

Nice to see that bug is fixed. At least I hope so. Dound place where it happens - when content of buffer bitmap with attached bview is copied to another bview - and destination view clipreg is set using source bitmap-view clipreg. code starts here

Btw, I could fix problem from inside Mozilla code, by resetting destview clipping to 0 after this line:

Probably I will publish that version too, inpite axeld fixed problem already, as I saw at IRC - just for comparison.

in reply to:  6 comment:9 by fyysik, 13 years ago

Replying to stippi:

well. In any case, please don't "fix" any code in Firefox. It is a good stress test for our app_server, and it needs to handle it. :-)

Heh, anyway, I published special version for unpatient testers and for comparison, according idea from my last comment:

Note: See TracTickets for help on using tickets.