X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/7709915e967383057bdad8748d9d23a327e5d749..a899707131e8b94a628c44309517128707ef6b57:/src/msw/tooltip.cpp diff --git a/src/msw/tooltip.cpp b/src/msw/tooltip.cpp index 98ef64a1b8..dd3fdd076b 100644 --- a/src/msw/tooltip.cpp +++ b/src/msw/tooltip.cpp @@ -40,6 +40,10 @@ #define TTTOOLINFO_V1_SIZE 0x28 #endif +#ifndef TTF_TRANSPARENT + #define TTF_TRANSPARENT 0x0100 +#endif + // VZ: normally, the trick with subclassing the tooltip control and processing // TTM_WINDOWFROMPOINT should work but, somehow, it doesn't. I leave the // code here for now (but it's not compiled) in case we need it later. @@ -90,7 +94,18 @@ public: hwnd = hwndOwner; uFlags = TTF_IDISHWND; - uId = (UINT)hwndOwner; + // we use TTF_TRANSPARENT to fix a problem which arises at least with + // the text controls but may presumably happen with other controls + // which display the tooltip at mouse position: it can start flashing + // then as the control gets "focus lost" events and dismisses the + // tooltip which then reappears because mouse remains hovering over the + // control, see SF patch 1821229 + if ( wxApp::GetComCtl32Version() >= 470 ) + { + uFlags |= TTF_TRANSPARENT; + } + + uId = (UINT_PTR)hwndOwner; } }; @@ -359,9 +374,12 @@ void wxToolTip::Add(WXHWND hWnd) } // only set a new width if it is bigger than the current setting - if (max > SendTooltipMessage(GetToolTipCtrl(), TTM_GETMAXTIPWIDTH, 0)) + if ( max > SendTooltipMessage(GetToolTipCtrl(), + TTM_GETMAXTIPWIDTH, 0) ) + { SendTooltipMessage(GetToolTipCtrl(), TTM_SETMAXTIPWIDTH, - (void *)max); + wxUIntToPtr(max)); + } } else #endif // comctl32.dll >= 4.70