[PATCH] comctl32/tooltips: Reset window subclass data when removing tools
Nikolay Sivov
nsivov at codeweavers.com
Wed Dec 20 17:05:09 CST 2017
Signed-off-by: Nikolay Sivov <nsivov at codeweavers.com>
---
Similar to b68dbf4ea1294a98ca653f32e88b07be632a5bae, intentionally separated because it's
not essential to fix original bug.
dlls/comctl32/tooltips.c | 22 +++++++++-------------
1 file changed, 9 insertions(+), 13 deletions(-)
diff --git a/dlls/comctl32/tooltips.c b/dlls/comctl32/tooltips.c
index 405b1e9f5c..1c8cb66422 100644
--- a/dlls/comctl32/tooltips.c
+++ b/dlls/comctl32/tooltips.c
@@ -1142,6 +1142,13 @@ TOOLTIPS_AddToolT (TOOLTIPS_INFO *infoPtr, const TTTOOLINFOW *ti, BOOL isW)
return TRUE;
}
+static void TOOLTIPS_ResetSubclass (const TTTOOL_INFO *toolPtr)
+{
+ /* Reset subclassing data. */
+ if (toolPtr->uInternalFlags & TTF_SUBCLASS)
+ SetWindowSubclass(toolPtr->uInternalFlags & TTF_IDISHWND ? (HWND)toolPtr->uId : toolPtr->hwnd,
+ TOOLTIPS_SubclassProc, 1, 0);
+}
static LRESULT
TOOLTIPS_DelToolT (TOOLTIPS_INFO *infoPtr, const TTTOOLINFOW *ti, BOOL isW)
@@ -1174,15 +1181,7 @@ TOOLTIPS_DelToolT (TOOLTIPS_INFO *infoPtr, const TTTOOLINFOW *ti, BOOL isW)
Free (toolPtr->lpszText);
}
- /* remove subclassing */
- if (toolPtr->uInternalFlags & TTF_SUBCLASS) {
- if (toolPtr->uInternalFlags & TTF_IDISHWND) {
- RemoveWindowSubclass((HWND)toolPtr->uId, TOOLTIPS_SubclassProc, 1);
- }
- else {
- RemoveWindowSubclass(toolPtr->hwnd, TOOLTIPS_SubclassProc, 1);
- }
- }
+ TOOLTIPS_ResetSubclass (toolPtr);
/* delete tool from tool list */
if (infoPtr->uNumTools == 1) {
@@ -1888,10 +1887,7 @@ TOOLTIPS_Destroy (TOOLTIPS_INFO *infoPtr)
}
}
- /* Reset subclassing data. */
- if (toolPtr->uInternalFlags & TTF_SUBCLASS)
- SetWindowSubclass(toolPtr->uInternalFlags & TTF_IDISHWND ? (HWND)toolPtr->uId : toolPtr->hwnd,
- TOOLTIPS_SubclassProc, 1, 0);
+ TOOLTIPS_ResetSubclass (toolPtr);
}
Free (infoPtr->tools);
--
2.15.1
More information about the wine-devel
mailing list