[PATCH] comctl32: Preserve tooltip size set by TTN_SHOW.

Nikolay Sivov bunglehead at gmail.com
Fri Feb 23 14:49:51 CST 2018


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.




More information about the wine-devel mailing list