[PATCH] [bug7055] tooltips uninitialized variables plus wrong positioning

Jason Edmeades jason.edmeades at googlemail.com
Tue Aug 14 15:48:27 CDT 2007


The bug reported uninitialized variable use, but while finding a program to
exercise that code (I ended up with a hacked vb one), I found we defaulted
the position of CENTERTIP BALLON tooltips incorrectly, so rewrote that
portion resolving both issues.
---
 dlls/comctl32/tooltips.c |    9 ++++++---
 1 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/dlls/comctl32/tooltips.c b/dlls/comctl32/tooltips.c
index 3b41dda..39401eb 100644
--- a/dlls/comctl32/tooltips.c
+++ b/dlls/comctl32/tooltips.c
@@ -569,15 +569,18 @@ TOOLTIPS_Show (HWND hwnd, TOOLTIPS_INFO *infoPtr)
 	if (style & TTS_BALLOON)
 	{
           ptfx = rc.left + ((rc.right - rc.left) / 2);
-          if(rect.top - size.cy >= 0)
+
+          /* CENTERTIP ballon tooltips default to below the field
+             if they fit on the screen                            */
+          if(rc.bottom + size.cy > GetSystemMetrics(SM_CYSCREEN))
           {
-            rect.top -= size.cy;
+            rect.top = rc.top - size.cy;
             infoPtr->bToolBelow = FALSE;
           }
           else
           {
             infoPtr->bToolBelow = TRUE;
-            rect.top += 20;
+            rect.top = rc.bottom;
           }
           rect.left = max(0, rect.left - BALLOON_STEMINDENT);
         }
-- 
1.5.0




More information about the wine-patches mailing list