[Mono-winforms-list] [PATCH] Synchronized Activation of windows
Carlos Alberto Cortez
calberto.cortez at gmail.com
Wed Mar 25 03:28:02 EDT 2009
Hey
While trying to fix #413898, I found that we are not activating the related
form when setting Form.Visible to true, as opposed to .net (we actually do
that in Application.RunLoop, however, which is used by both
Application.Run() and Form.ShowDialog()).
An additional problem is the fact that trying to activate the form when made
visible (Form.SetVisibleCore in this case) is not a guarantee of receiving
the WM_ACTIVATE message in time before the form gets closed (not a problem
in both Application.Run and Form.ShowDialog), specially because we have to
send a message to the window manager, then wait for a X message, then
internally process in our own winforms queue.
So after trying several approachs, I came up with the simple attached patch,
that basically adds a synchronized version of the XplatUI.Activate method,
which in X11 sends the appropriate message to the window manager and then
sits to wait till we have processed it. Even if simple, and could run all
the test suite, I'm not very sure, because a synchronized call sounds
dangerous, and because I thought that maybe somebody could know why we
hadn't something like this before ;-).
Thoughts?
Carlos.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.ximian.com/pipermail/mono-winforms-list/attachments/20090325/e78f4f32/attachment.html
-------------- next part --------------
A non-text attachment was scrubbed...
Name: activate-synch.patch
Type: text/x-patch
Size: 3160 bytes
Desc: not available
Url : http://lists.ximian.com/pipermail/mono-winforms-list/attachments/20090325/e78f4f32/attachment.bin
More information about the Mono-winforms-list
mailing list