On Tue, Nov 25, 2008 at 4:04 AM, Stefan Dösinger <[EMAIL PROTECTED]> wrote: >> Isn't this already covered in the cursoricon tests? > I don't think so. That test would be marked TODO_WINE in that case, so your > patch would cause a test failure(unexpected success). If that test wasn't > marked todo the behavior your patch adds would be implemented already.
A patch I sent in recently (attached for convenience) should let Wine know that it is dealing with a cursor loaded from an .ico. After this gets commited, then we can see where the hotspot should be for such a cursor (after Wine knows about it internally.) If I recall correctly, GetIconInfo() returns (width/2, height/2) for the hotspot of all .ico's. I will write a test for this. Even so, the cursor hotspot returned by GetIconInfo() might very will be different from what Win32 actually uses when drawing the cursor, so I will have to write another interactive test for this so I can see what Win32 actually does. The interactive test, unless specifically asked for, I probably won't send in because it is impossible to automate. (Just check manually by clicking on stuff where the hotspot of a cursor loaded from a .ico is. - Hopefully this will match GetIconInfo() behavior, or at least use (0,0).) Krzysztof: Please test the attached patch against your program/game to see what, if anything, it does to fix this issue. -- Andrew Riedi
From 2889ad53fe05db4151a2af55f8b7bc63d80e9f84 Mon Sep 17 00:00:00 2001 From: Andrew Riedi <[EMAIL PROTECTED]> Date: Sun, 23 Nov 2008 17:07:34 -0800 Subject: [PATCH] user32: Make the hotspot ICON_HOTSPOT when loading icons. Based on patches by Henri Verbeet. --- dlls/user32/cursoricon.c | 13 +++++++++++-- 1 files changed, 11 insertions(+), 2 deletions(-) diff --git a/dlls/user32/cursoricon.c b/dlls/user32/cursoricon.c index 26676de..655a74a 100644 --- a/dlls/user32/cursoricon.c +++ b/dlls/user32/cursoricon.c @@ -1124,8 +1124,17 @@ static HICON CURSORICON_LoadFromFile( LPCWSTR filename, if ( entry->dwDIBOffset + entry->dwDIBSize > filesize ) goto end; - hotspot.x = entry->xHotspot; - hotspot.y = entry->yHotspot; + /* Set the actual hotspot for cursors and ICON_HOTSPOT for icons. */ + if ( fCursor ) + { + hotspot.x = entry->xHotspot; + hotspot.y = entry->yHotspot; + } + else + { + hotspot.x = ICON_HOTSPOT; + hotspot.y = ICON_HOTSPOT; + } hIcon = CURSORICON_CreateIconFromBMI( (BITMAPINFO *)&bits[entry->dwDIBOffset], hotspot, !fCursor, 0x00030000, width, height, loadflags ); -- 1.5.6.3