Monday, November 14, 2005

Event handling

The font stuff is still not completed, but it works good enough to leave it as is for now. Missing is foremost work on the font cache - I haven't done anything in this regard yet.

In the last days I've mostly fixed bugs, and cleaned up things - there are still enough bugs left, but overall things are improving. Next topic I'd like to work on is the event handling in the app_server.

While I haven't got a detailed plan yet, the basic idea is to make it more flexible and move it out of the class currently taking care of it (RootLayer). While that probably wouldn't keep me busy for too long, I will also try to move as much functionality as possible to the client. The app_server will only make sure the right window gets the event - the rest is mostly up to the client. An exception to this rule are views that are using the BView::SetEventMask() feature; they need special care as they may demand getting events even if they don't have focus and are not below the mouse cursor.

I will also attack a problem that is mostly visible when using Haiku in Qemu or when an application becomes unresponsive: the mouse cursor visually hangs and makes navigation quite hard. The reason for this is quite simple: every mouse move is sent to the window below the mouse cursor - if that one is currently busy, the app_server waits a bit until it gives up sending the message: and that delay is what's responsible for the hanging mouse cursor.

The solution to this problem is the decoupling of the "mouse moved" messages and the updating of the cursor on screen as BeOS does it for ages. A high priority thread will do nothing else than waiting for notifications that the mouse cursor has been moved - these notifications are not sent over ports, but use shared memory to cause as little delay as possible between the physical mouse move and the visual feedback on screen. Now the window can take as long as it wants to read its messages, it won't impact the cursor movement anymore.
Jérôme has already laid the foundation to this, and I will move this into the new event handling design and make sure it'll work.

7 Comments:

At 4:54 AM, therandthem said...

I'd like to give a vote to anything that makes things work better in qemu. Thanks again.

 
At 4:34 AM, Alex Harvey said...

Woot!!! Great work, keep it up. I check everyday for new timbits to read.

Alex

 
At 8:43 PM, ModeenF said...

Me to :)

 
At 1:07 AM, HeinzVoerbakje said...

Hello Axel,

Maybe a stupid question, but I can't find it anywhere on the web. What is the timeframe you are thinking about for a first (candidate-) release of Haiku?

I can't wait! Keep up the good work!

HeinzVoerbakje
Ps. Where can I donate?

 
At 9:25 AM, ModeenF said...

Haiku?
http://haiku-os.org/learn.php

 
At 9:29 PM, Mr sKoE said...

No more wonderful Posts? :-(.

 
At 10:09 PM, Axel Dörfler said...

To HeinzVoerbakje: I hope you found what you were looking for in the mean time.

To mr_skoe: Even if it's been some days since I wrote the last post, I'll definitely continue doing this - I am just working away on the app_server, and it's hard to tell progress. I almost wrote a post today, though, but I got distracted last minute - won't be long until the next post :-)
Thanks for your interest!

 

Post a Comment

<< Home