Fixes https://bugs.winehq.org/show_bug.cgi?id=14336.
Signed-off-by: Roman Pišl rpisl@seznam.cz --- dlls/comctl32/tooltips.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/dlls/comctl32/tooltips.c b/dlls/comctl32/tooltips.c index 12f2d4b81c..c0c020b7fc 100644 --- a/dlls/comctl32/tooltips.c +++ b/dlls/comctl32/tooltips.c @@ -634,7 +634,13 @@ TOOLTIPS_Show (TOOLTIPS_INFO *infoPtr, BOOL track_activate)
TRACE("%s\n", debugstr_w(infoPtr->szTipText));
- TOOLTIPS_CalcTipSize (infoPtr, &size); + GetWindowRect(infoPtr->hwndSelf, &rect); + size.cx = rect.right - rect.left; + size.cy = rect.bottom - rect.top; + if (size.cx <= 0 || size.cy <= 0) + { + TOOLTIPS_CalcTipSize (infoPtr, &size); + } TRACE("size %d x %d\n", size.cx, size.cy);
if (track_activate && (toolPtr->uFlags & TTF_TRACK))
On 2/23/2018 8:51 PM, Roman Pišl wrote:
@@ -634,7 +634,13 @@ TOOLTIPS_Show (TOOLTIPS_INFO *infoPtr, BOOL track_activate)
TRACE("%s\n", debugstr_w(infoPtr->szTipText));
- TOOLTIPS_CalcTipSize (infoPtr, &size);
GetWindowRect(infoPtr->hwndSelf, &rect);
size.cx = rect.right - rect.left;
size.cy = rect.bottom - rect.top;
if (size.cx <= 0 || size.cy <= 0)
{
TOOLTIPS_CalcTipSize (infoPtr, &size);
} TRACE("size %d x %d\n", size.cx, size.cy);
if (track_activate && (toolPtr->uFlags & TTF_TRACK))
I get the idea, but it's not obvious at all that this is a right way to fix it.
We'll need to test a number of things:
- is window already resized by the time TTN_SHOW is sent; - what happens if TTN_SHOW handler itself reduces width or height to zero; - how non zero TTN_SHOW return value affects things; - if TTN_SHOW does not touch window size, do we have to resize at all, e.g. if window was created as (0,0)-(10,10) initially but contents don't fit in this square; - what happens to TTS_BALLOON when window is resized by TTN_SHOW handler; - if window resized/repositioned during TTN_SHOW should be skip the rest of the function, and use SWP_NOSIZE|SWP_NOMOVE.