[Wine-patches] [eter-2.1] comctl32: Test appropriate tool window for active state. (eterbug #634)

Dmitry Timoshkov dtimoshkov на etersoft.ru
Ср Фев 6 07:56:31 MSK 2013


There is no point in testing owner of the tooltip itself since it's often
created as a popup of the desktop window.

(cherry picked from commit 7b3305169c4d1b3c5107c1b2bd9e5f2785020ed6)
---
 dlls/comctl32/tooltips.c | 14 +++++++++++---
 1 file changed, 11 insertions(+), 3 deletions(-)

diff --git a/dlls/comctl32/tooltips.c b/dlls/comctl32/tooltips.c
index 736758e..d5141ed 100644
--- a/dlls/comctl32/tooltips.c
+++ b/dlls/comctl32/tooltips.c
@@ -991,9 +991,17 @@ TOOLTIPS_CheckTool (const TOOLTIPS_INFO *infoPtr, BOOL bShowTest)
     if (nTool == -1)
 	return -1;
 
-    if (!(GetWindowLongW (infoPtr->hwndSelf, GWL_STYLE) & TTS_ALWAYSTIP) && bShowTest) {
-	if (!TOOLTIPS_IsWindowActive (GetWindow (infoPtr->hwndSelf, GW_OWNER)))
-	    return -1;
+    if (!(GetWindowLongW (infoPtr->hwndSelf, GWL_STYLE) & TTS_ALWAYSTIP) && bShowTest)
+    {
+        TTTOOL_INFO *ti = &infoPtr->tools[nTool];
+        HWND hwnd = (ti->uFlags & TTF_IDISHWND) ? (HWND)ti->uId : ti->hwnd;
+
+        if (!TOOLTIPS_IsWindowActive(hwnd))
+        {
+            TRACE("not active: hwnd %p, parent %p, active %p\n",
+                  hwnd, GetParent(hwnd), GetActiveWindow());
+            return -1;
+        }
     }
 
     TRACE("tool %d\n", nTool);
-- 
1.8.0.2



Подробная информация о списке рассылки Wine-patches