Author: toshok
Date: 2006-09-11 22:08:20 -0400 (Mon, 11 Sep 2006)
New Revision: 65270
Modified:
trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog
trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/XEventQueue.cs
trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/XplatUIX11.cs
Log:
* XEventQueue.cs: add a DispatchIdle property.
* XplatUIX11.cs (UpdateMessageQueue): only emit the Idle event if
either the queue is null, or the queue has DispatchIdle set to
true.
(DoEvents): set queue.DispatchIdle to false around the
peek/translate/dispatch message loop in this method. This keeps
Application.Doevents from emitting idle events. Part of the fix
for #78823.
2006-09-11 Chris Toshok <[EMAIL PROTECTED]>
Modified: trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog
===================================================================
--- trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog
2006-09-12 01:37:21 UTC (rev 65269)
+++ trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog
2006-09-12 02:08:20 UTC (rev 65270)
@@ -1,5 +1,17 @@
2006-09-11 Chris Toshok <[EMAIL PROTECTED]>
+ * XEventQueue.cs: add a DispatchIdle property.
+
+ * XplatUIX11.cs (UpdateMessageQueue): only emit the Idle event if
+ either the queue is null, or the queue has DispatchIdle set to
+ true.
+ (DoEvents): set queue.DispatchIdle to false around the
+ peek/translate/dispatch message loop in this method. This keeps
+ Application.Doevents from emitting idle events. Part of the fix
+ for #78823.
+
+2006-09-11 Chris Toshok <[EMAIL PROTECTED]>
+
* DataGrid.cs (set_DataSource): make this work for both the
winforms/datagrid test and ReportBuilder. It seems as though when
we've created a ListManager (or maybe it's if we have a
Modified:
trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/XEventQueue.cs
===================================================================
--- trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/XEventQueue.cs
2006-09-12 01:37:21 UTC (rev 65269)
+++ trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/XEventQueue.cs
2006-09-12 02:08:20 UTC (rev 65270)
@@ -40,6 +40,7 @@
internal ArrayList timer_list;
private Thread thread;
private bool quit_posted;
+ private bool dispatch_idle;
private static readonly int InitialXEventSize = 100;
private static readonly int InitialLXEventSize = 10;
@@ -52,6 +53,7 @@
timer_list = new ArrayList ();
this.thread = thread;
this.quit_posted = false;
+ this.handle_idle = true;
}
public int Count {
@@ -106,6 +108,15 @@
return xqueue.Peek();
}
+ public bool DispatchIdle {
+ get {
+ return dispatch_idle;
+ }
+ set {
+ dispatch_idle = value;
+ }
+ }
+
public bool PostQuitState {
get {
return quit_posted;
Modified:
trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/XplatUIX11.cs
===================================================================
--- trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/XplatUIX11.cs
2006-09-12 01:37:21 UTC (rev 65269)
+++ trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/XplatUIX11.cs
2006-09-12 02:08:20 UTC (rev 65270)
@@ -1162,7 +1162,7 @@
}
if (pending == 0) {
- if (Idle != null) {
+ if ((queue == null || queue.DispatchIdle) &&
Idle != null) {
Idle (this, EventArgs.Empty);
}
@@ -2784,18 +2784,22 @@
internal override void DoEvents() {
MSG msg = new MSG ();
- Object queue_id;
+ XEventQueue queue;
if (OverrideCursorHandle != IntPtr.Zero) {
OverrideCursorHandle = IntPtr.Zero;
}
- queue_id = (Object)ThreadQueue(Thread.CurrentThread);
+ queue = ThreadQueue(Thread.CurrentThread);
- while (PeekMessage(queue_id, ref msg, IntPtr.Zero, 0,
0, (uint)PeekMessageFlags.PM_REMOVE)) {
+ queue.DispatchIdle = false;
+
+ while (PeekMessage(queue, ref msg, IntPtr.Zero, 0, 0,
(uint)PeekMessageFlags.PM_REMOVE)) {
TranslateMessage (ref msg);
DispatchMessage (ref msg);
}
+
+ queue.DispatchIdle = true;
}
internal override void EnableWindow(IntPtr handle, bool Enable)
{
_______________________________________________
Mono-patches maillist - [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches