=?UTF-8?Q?Roman=20Pi=C5=A1l=20?=: comctl32/tooltips: Set window size before TTN_SHOW and preserve it after.

Alexandre Julliard julliard at winehq.org
Wed Feb 28 15:39:33 CST 2018


Module: wine
Branch: master
Commit: 4803b7abc9633125d38e2fa4cc099d44fe497edc
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=4803b7abc9633125d38e2fa4cc099d44fe497edc

Author: Roman Pišl <rpisl at seznam.cz>
Date:   Wed Feb 28 09:00:05 2018 +0300

comctl32/tooltips: Set window size before TTN_SHOW and preserve it after.

Signed-off-by: Nikolay Sivov <nsivov at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/comctl32/tests/tooltips.c |  1 -
 dlls/comctl32/tooltips.c       | 27 +++++++++++++--------------
 2 files changed, 13 insertions(+), 15 deletions(-)

diff --git a/dlls/comctl32/tests/tooltips.c b/dlls/comctl32/tests/tooltips.c
index 7f37d5f..af95a56 100644
--- a/dlls/comctl32/tests/tooltips.c
+++ b/dlls/comctl32/tests/tooltips.c
@@ -304,7 +304,6 @@ static LRESULT WINAPI parent_wnd_proc(HWND hwnd, UINT message, WPARAM wParam, LP
             break;
         case TTN_SHOW:
             GetWindowRect(hdr->hwndFrom, &rect);
-        todo_wine
             ok(!EqualRect(&g_ttip_rect, &rect), "Unexpected window rectangle.\n");
             break;
         }
diff --git a/dlls/comctl32/tooltips.c b/dlls/comctl32/tooltips.c
index e5b966a..5460101 100644
--- a/dlls/comctl32/tooltips.c
+++ b/dlls/comctl32/tooltips.c
@@ -624,18 +624,10 @@ TOOLTIPS_Show (TOOLTIPS_INFO *infoPtr, BOOL track_activate)
     }
 
     toolPtr = &infoPtr->tools[nTool];
-
-    TRACE("Show tooltip %d\n", nTool);
-
-    hdr.hwndFrom = infoPtr->hwndSelf;
-    hdr.idFrom = toolPtr->uId;
-    hdr.code = TTN_SHOW;
-    SendMessageW (toolPtr->hwnd, WM_NOTIFY, toolPtr->uId, (LPARAM)&hdr);
-
-    TRACE("%s\n", debugstr_w(infoPtr->szTipText));
-
     TOOLTIPS_CalcTipSize (infoPtr, &size);
-    TRACE("size %d x %d\n", size.cx, size.cy);
+
+    TRACE("Show tooltip %d, %s, size %d x %d\n", nTool, debugstr_w(infoPtr->szTipText),
+        size.cx, size.cy);
 
     if (track_activate && (toolPtr->uFlags & TTF_TRACK))
     {
@@ -824,9 +816,16 @@ TOOLTIPS_Show (TOOLTIPS_INFO *infoPtr, BOOL track_activate)
          * it is no longer needed */
     }
 
-    SetWindowPos (infoPtr->hwndSelf, HWND_TOPMOST, rect.left, rect.top,
-		    rect.right - rect.left, rect.bottom - rect.top,
-		    SWP_SHOWWINDOW | SWP_NOACTIVATE);
+    SetWindowPos (infoPtr->hwndSelf, NULL, rect.left, rect.top,
+        rect.right - rect.left, rect.bottom - rect.top, SWP_NOZORDER | SWP_NOACTIVATE);
+
+    hdr.hwndFrom = infoPtr->hwndSelf;
+    hdr.idFrom = toolPtr->uId;
+    hdr.code = TTN_SHOW;
+    SendMessageW (toolPtr->hwnd, WM_NOTIFY, toolPtr->uId, (LPARAM)&hdr);
+
+    SetWindowPos (infoPtr->hwndSelf, HWND_TOPMOST, 0, 0, 0, 0,
+        SWP_NOSIZE | SWP_NOMOVE | SWP_SHOWWINDOW | SWP_NOACTIVATE);
 
     /* repaint the tooltip */
     InvalidateRect(infoPtr->hwndSelf, NULL, TRUE);




More information about the wine-cvs mailing list