https://git.reactos.org/?p=reactos.git;a=commitdiff;h=9e4d2f1f9e9529bc1e8b9…
commit 9e4d2f1f9e9529bc1e8b9d8c3ab2e0b398fbf2b5
Author: Mark Jansen <mark.jansen(a)reactos.org>
AuthorDate: Sat Nov 4 15:00:54 2017 +0100
[WIN32K] Check if the window being destroyed is currently tracked. (#103)
* [WIN32K] Check if the window being destroyed is currently tracked.
CORE-13619
---
win32ss/user/ntuser/mouse.c | 20 ++++++++++++++++++++
win32ss/user/ntuser/window.c | 12 ++++++++++++
2 files changed, 32 insertions(+)
diff --git a/win32ss/user/ntuser/mouse.c b/win32ss/user/ntuser/mouse.c
index fc3827e345..46dfcfdd4f 100644
--- a/win32ss/user/ntuser/mouse.c
+++ b/win32ss/user/ntuser/mouse.c
@@ -342,6 +342,26 @@ UserSendMouseInput(MOUSEINPUT *pmi, BOOL bInjected)
return TRUE;
}
+VOID
+FASTCALL
+IntRemoveTrackMouseEvent(
+ PDESKTOP pDesk)
+{
+ /* Generate a leave message */
+ if (pDesk->dwDTFlags & DF_TME_LEAVE)
+ {
+ UINT uMsg = (pDesk->htEx != HTCLIENT) ? WM_NCMOUSELEAVE : WM_MOUSELEAVE;
+ UserPostMessage(UserHMGetHandle(pDesk->spwndTrack), uMsg, 0, 0);
+ }
+ /* Kill the timer */
+ if (pDesk->dwDTFlags & DF_TME_HOVER)
+ IntKillTimer(pDesk->spwndTrack, ID_EVENT_SYSTIMER_MOUSEHOVER, TRUE);
+
+ /* Reset state */
+ pDesk->dwDTFlags &= ~(DF_TME_LEAVE|DF_TME_HOVER);
+ pDesk->spwndTrack = NULL;
+}
+
BOOL
FASTCALL
IntQueryTrackMouseEvent(
diff --git a/win32ss/user/ntuser/window.c b/win32ss/user/ntuser/window.c
index b8a3b59bfe..9c7627cece 100644
--- a/win32ss/user/ntuser/window.c
+++ b/win32ss/user/ntuser/window.c
@@ -381,6 +381,12 @@ DWORD FASTCALL IntGetWindowContextHelpId( PWND pWnd )
return HelpId;
}
+
+VOID
+FASTCALL
+IntRemoveTrackMouseEvent(
+ PDESKTOP pDesk);
+
/***********************************************************************
* IntSendDestroyMsg
*/
@@ -422,6 +428,12 @@ static void IntSendDestroyMsg(HWND hWnd)
{
co_IntDestroyCaret(ti);
}
+
+ /* If the window being destroyed is currently tracked... */
+ if (ti->rpdesk->spwndTrack == Window)
+ {
+ IntRemoveTrackMouseEvent(ti->rpdesk);
+ }
}
/* If the window being destroyed is the current clipboard owner... */