[Mono-winforms-list] current status of the mwf-handle-branch branch
Chris Toshok
toshok at ximian.com
Tue Feb 20 20:29:56 EST 2007
So, I'm running into a number of walls to getting this branch in a state
where I can merge it back in. Running the unit tests revealed that
there were a number of instances where the XplatUIX11.WaitForHwndMessage
method wasn't behaving as synchronously as it needed to.
It turns out that PeekMessage can (and does) return false when there are
no pending X events. We need to loop forever, though, so we need to
wrap the PeekMessage call in a different loop that tests to make sure
we've actually seen the message we're waiting on.
So, after fixing WaitForHwndMessage to work properly, some unit tests
cause everything to hang. The reason for this is that
WaitForHwndMessage doesn't listen for WM_QUIT to know it should exit.
So I add support for this, but then notice that nowhere in the X11 code
do we generate WM_QUIT (windows does in response to a call to
PostQuitMessage). It looks like PostQuitMessage doesn't mean what it's
supposed to mean in MWF. Also, in order to get the nested loop to exit
and return control to the parent loop with the WM_QUIT message still in
the queue, we need to implement PM_NOREMOVE functionality for
XplatUIX11.PeekMessage.
So my current thinking is this:
1. get PM_NOREMOVE working.
2. fix up the mis-usage of PostQuitState in the X11 backend
3. find all the cases where we should be generating a WM_QUIT, fix
up Application.cs and ApplicationContext.cs to quit in the right
way, and destroy the forms in the right way. Also add support
for WM_QUIT to the RunLoop in Application.cs.
4. fix WaitForHwndMessage to peek without removing messages, and
add support for WM_QUIT.
5. ...
6. the next wall I hit.
confused yet? I am.. if anyone wants to help out on getting this
branch working, let me know :)
Chris
More information about the Mono-winforms-list
mailing list