[Mono-bugs] [Bug 77282][Wis] New - Application.DoEvents does not
work right
bugzilla-daemon at bugzilla.ximian.com
bugzilla-daemon at bugzilla.ximian.com
Mon Jan 16 20:00:12 EST 2006
Please do not reply to this email- if you want to comment on the bug, go to the
URL shown below and enter your comments there.
Changed by don at edvalson.net.
http://bugzilla.ximian.com/show_bug.cgi?id=77282
--- shadow/77282 2006-01-16 20:00:12.000000000 -0500
+++ shadow/77282.tmp.16028 2006-01-16 20:00:12.000000000 -0500
@@ -0,0 +1,70 @@
+Bug#: 77282
+Product: Mono: Class Libraries
+Version: 1.1
+OS:
+OS Details: Tested on Win32 and OSX X11
+Status: NEW
+Resolution:
+Severity:
+Priority: Wishlist
+Component: Windows.Forms
+AssignedTo: peter at novonyx.com
+ReportedBy: don at edvalson.net
+QAContact: mono-bugs at ximian.com
+TargetMilestone: ---
+URL:
+Cc:
+Summary: Application.DoEvents does not work right
+
+Please fill in this template when reporting a bug, unless you know what
+you are doing.
+Description of Problem:
+
+DoEvents does not do all events
+
+Steps to reproduce the problem:
+enter code like this -
+
+while (!Exit)
+{
+ Application.DoEvents()this.Invoke (this.EvDelegate, null);
+ Thread.Sleep (500);
+}
+
+Actual Results:
+App quits responding to Menus, Buttons, etc.
+
+Expected Results:
+App keeps responding
+
+How often does this happen?
+always
+
+Additional Information:
+This is because the function DoEvents in XPlatUIWin32.cs is written as
+follows:
+
+while (Win32PeekMessage(ref msg, IntPtr.Zero, 0, 0, (uint)
+PeekMessageFlags.PM_REMOVE)!=true)
+{
+ if (msg.message==Msg.WM_PAINT) {
+ XplatUI.TranslateMessage(ref msg);
+ XplatUI.DispatchMessage(ref msg);
+ }
+}
+
+There are two problems here. First, the while should say == true, not !=
+true. Second, the test for WM_PAINT should not be there. Thus, the
+following is correct.
+
+while (Win32PeekMessage(ref msg, IntPtr.Zero, 0, 0, (uint)
+PeekMessageFlags.PM_REMOVE)==true)
+{
+ XplatUI.TranslateMessage(ref msg);
+ XplatUI.DispatchMessage(ref msg);
+}
+
+The if statement needs to be removed from the X11 version also.
+
+With this change, my application behaves the same as when running under
+MS .NET
More information about the mono-bugs
mailing list