https://bugs.winehq.org/show_bug.cgi?id=38298
Bug ID: 38298 Summary: TTN_SHOW is not implemented correctly Product: Wine Version: 1.7.34 Hardware: x86 OS: Linux Status: UNCONFIRMED Severity: normal Priority: P2 Component: comctl32 Assignee: wine-bugs@winehq.org Reporter: pietro10@mac.com Distribution: ---
According to MSDN (https://msdn.microsoft.com/en-us/library/windows/desktop/bb760314%28v=vs.85%...), TTN_SHOW in comctl32.dll >= 4.70 has special logic for allowing customization of tooltip size and position:
Version 4.70. To display the tooltip in its default location, return zero. To customize the tooltip position, reposition the tooltip window with the SetWindowPos function and return TRUE.
Note: For versions earlier than 4.70, there is no return value.
This is needed to implement in-place tooltips, such as the ones you get when you hover the mouse over a listview in report mode (with LVS_EX_LABELTIP) or a tree view (by default, it seems), or in this picture: https://i-msdn.sec.s-msft.com/dynimg/IC510747.png.
However, wine currently does not follow these rules. According to http://source.winehq.org/source/dlls/comctl32/tooltips.c?!v=wine-1.7.39#0621, it just sends the TTN_SHOW notification, ignoring the return value entirely, then proceeds to set the default window position anyway. As such, in-place tooltips will simply appear where they would if they were regular tooltips (underneath the mouse cursor).
I personally tested with wine 1.7.34 (or some commit around that one) from source and Windows XP and Windows 7 with my own in-place tooltips as part of a table control of my own creation. On real Windows, Common Controls 5 and 6 both have TTN_SHOW working properly (but given it says 4.70 I'm not surprised).
I'm not the first to notice wrong tooltip behavior. Someone (I don't know if it's just a user or one of the authors of Cardbox) noticed that Cardbox relied on another aspect of TTN_SHOW that wine doesn't imitate: real Windows computes the default tooltip position before sending the notification, not after (as wine still does). In fact, he noticed this back in 2007! I'm not sure why a bug here was never filed... https://cardboxeverywhere.wordpress.com/2007/12/11/programming-note-tooltips...
I don't have a minimal test program on hand (the source speaks for itself) but here's something Raymond Chen wrote on the subject that can be constructed into one: http://blogs.msdn.com/b/oldnewthing/archive/2006/06/26/647365.aspx
Thanks.
https://bugs.winehq.org/show_bug.cgi?id=38298
--- Comment #1 from Nikolay Sivov bunglehead@gmail.com --- Hi, Pietro.
Thank you for detailed description. Regarding using return value - it's trivial to fix. Second part is more interesting, do you mean that native implementation sends TTN_SHOW after tooltip window was positioned? In Wine case that would be after this part:
--- SetWindowPos (infoPtr->hwndSelf, HWND_TOPMOST, rect.left, rect.top, rect.right - rect.left, rect.bottom - rect.top, SWP_SHOWWINDOW | SWP_NOACTIVATE); ---
How do you check that it's sent after this? Directly using tooltip window handle or there's some other side effect that makes it obvious?
https://bugs.winehq.org/show_bug.cgi?id=38298
Roman Pisl rpisl@seznam.cz changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |rpisl@seznam.cz
https://bugs.winehq.org/show_bug.cgi?id=38298
--- Comment #2 from Roman Pišl rpisl@seznam.cz --- This is fixed by https://source.winehq.org/git/wine.git/commit/4803b7abc9633125d38e2fa4cc099d.... Nikolay, thank you for finishing the patch.
https://bugs.winehq.org/show_bug.cgi?id=38298
--- Comment #3 from Nikolay Sivov bunglehead@gmail.com --- Not yet, return value currently is not used.