2008-08-15 Carlos Alberto Cortez <calberto.cortez@gmail.com>
authorCarlos Alberto Cortez <calberto.cortez@gmail.com>
Fri, 15 Aug 2008 16:58:04 +0000 (16:58 -0000)
committerCarlos Alberto Cortez <calberto.cortez@gmail.com>
Fri, 15 Aug 2008 16:58:04 +0000 (16:58 -0000)
* XplatUIX11.cs: Increase the interval for the Timer, to not fire our
pseudo motion HandleMouseOver method so aggresive. Also, don't call it
when the pointer is actually in motion, but only when the pointer
seems to stop (as .net does).
Fixes part of #381876.

svn path=/trunk/mcs/; revision=110578

mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog
mcs/class/Managed.Windows.Forms/System.Windows.Forms/XplatUIX11.cs

index 48ba5900f5d3b4737c667563c867d3c18c3a19a2..e5521596dcfd4d9173a02a65113cdbfcac4c2c29 100644 (file)
@@ -1,3 +1,11 @@
+2008-08-15  Carlos Alberto Cortez <calberto.cortez@gmail.com>
+
+       * XplatUIX11.cs: Increase the interval for the Timer, to not fire our
+       pseudo motion HandleMouseOver method so aggresive. Also, don't call it
+       when the pointer is actually in motion, but only when the pointer
+       seems to stop (as .net does).
+       Fixes part of #381876.
+
 2008-08-15  Ivan N. Zlatev  <contact@i-nz.net>
 
        * GridEntry.cs: Perform stricter check for the ParentEntry's 
index 82b45385091212add01b31c452ed2d3c0b914181..c83cf70c15d06533c009ea37b81112a336478021 100644 (file)
@@ -133,6 +133,9 @@ namespace System.Windows.Forms {
                // Caret
                private static CaretStruct      Caret;                  //
 
+               // Last window containing the pointer
+               private static IntPtr           LastPointerWindow;      // The last window containing the pointer
+
                // Our atoms
                private static IntPtr WM_PROTOCOLS;
                private static IntPtr WM_DELETE_WINDOW;
@@ -4009,9 +4012,24 @@ namespace System.Windows.Forms {
                                        if (!hwnd.Enabled) {
                                                goto ProcessNextMessage;
                                        }
-                                       if (xevent.CrossingEvent.mode != NotifyMode.NotifyNormal && xevent.CrossingEvent.window != hwnd.client_window) {
+                                       if (xevent.CrossingEvent.mode == NotifyMode.NotifyGrab || LastPointerWindow == xevent.CrossingEvent.window ||
+                                                       hwnd.client_window == IntPtr.Zero) {
                                                goto ProcessNextMessage;
                                        }
+                                       if (LastPointerWindow != IntPtr.Zero) {
+                                               Point enter_loc = new Point (xevent.ButtonEvent.x, xevent.ButtonEvent.y);
+
+                                               // We need this due to EnterNotify being fired on all the parent controls
+                                               // of the Control being grabbed, and obviously in that scenario we are not
+                                               // actuallty entering them
+                                               Control ctrl = Control.FromHandle (hwnd.client_window);
+                                               foreach (Control child_control in ctrl.Controls)
+                                                       if (child_control.Bounds.Contains (enter_loc))
+                                                               goto ProcessNextMessage;
+                                       }
+
+                                       LastPointerWindow = xevent.AnyEvent.window;
+
                                        msg.message = Msg.WM_MOUSE_ENTER;
                                        HoverState.X = xevent.CrossingEvent.x;
                                        HoverState.Y = xevent.CrossingEvent.y;