Author: pbartok
Date: 2006-05-18 18:49:25 -0400 (Thu, 18 May 2006)
New Revision: 60847

Modified:
   trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog
   trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/Cursor.cs
   trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/XplatUIX11.cs
Log:
2006-05-18  Peter Dennis Bartok  <[EMAIL PROTECTED]>

        * XplatUIX11.cs (DefWndProc): WM_SETCURSOR: Assign the return value 
          from the call to NativeWindow to avoid walking up the parent chain
          further than needed (speeds up setting cursors and avoids setting
          the wrong cursor if a parent has another cursor defined)
        * Cursor.cs: When loading an icon as cursor, MS uses the center of
          the icon as hotspot, not what's contained as hotspot in the icon
          file. This fixes the perceived drawing offset seen with Paint.Net
        


Modified: trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog
===================================================================
--- trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog        
2006-05-18 22:43:05 UTC (rev 60846)
+++ trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog        
2006-05-18 22:49:25 UTC (rev 60847)
@@ -1,3 +1,13 @@
+2006-05-18  Peter Dennis Bartok  <[EMAIL PROTECTED]>
+
+       * XplatUIX11.cs (DefWndProc): WM_SETCURSOR: Assign the return value 
+         from the call to NativeWindow to avoid walking up the parent chain
+         further than needed (speeds up setting cursors and avoids setting
+         the wrong cursor if a parent has another cursor defined)
+       * Cursor.cs: When loading an icon as cursor, MS uses the center of
+         the icon as hotspot, not what's contained as hotspot in the icon
+         file. This fixes the perceived drawing offset seen with Paint.Net
+       
 2006-05-18  Peter Dennis Bartok  <[EMAIL PROTECTED]> 
 
        * XplatUIX11.cs: 

Modified: trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/Cursor.cs
===================================================================
--- trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/Cursor.cs        
2006-05-18 22:43:05 UTC (rev 60846)
+++ trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/Cursor.cs        
2006-05-18 22:49:25 UTC (rev 60847)
@@ -401,7 +401,7 @@
                        cursor_dir.idType = reader.ReadUInt16();
                        if (cursor_dir.idReserved != 0 || !(cursor_dir.idType 
== 2 || cursor_dir.idType == 1))
                                throw new System.ArgumentException ("Invalid 
Argument, format error", "stream");
-               
+
                        entry_count = reader.ReadUInt16();
                        cursor_dir.idCount = entry_count;
                        cursor_dir.idEntries = new CursorEntry[entry_count];
@@ -417,6 +417,10 @@
                                ce.reserved = reader.ReadByte();
                                ce.xHotspot = reader.ReadUInt16();
                                ce.yHotspot = reader.ReadUInt16();
+                               if (cursor_dir.idType == 1) {
+                                       ce.xHotspot = (ushort)(ce.width / 2);
+                                       ce.yHotspot = (ushort)(ce.height / 2);
+                               }
                                ce.sizeInBytes = reader.ReadUInt32();
                                ce.fileOffset = reader.ReadUInt32();
 

Modified: 
trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/XplatUIX11.cs
===================================================================
--- trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/XplatUIX11.cs    
2006-05-18 22:43:05 UTC (rev 60846)
+++ trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/XplatUIX11.cs    
2006-05-18 22:49:25 UTC (rev 60847)
@@ -2516,7 +2516,7 @@
                                        // Pass to parent window first
                                        while ((hwnd.parent != null) && 
(msg.Result == IntPtr.Zero)) {
                                                hwnd = hwnd.parent;
-                                               
NativeWindow.WndProc(hwnd.Handle, Msg.WM_SETCURSOR, msg.HWnd, msg.LParam);
+                                               msg.Result = 
NativeWindow.WndProc(hwnd.Handle, Msg.WM_SETCURSOR, msg.HWnd, msg.LParam);
                                        }
 
                                        if (msg.Result == IntPtr.Zero) {

_______________________________________________
Mono-patches maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches

Reply via email to