Zebediah Figura : user32: Update mouse tracking information based on the timer ID in DispatchMessage().
Alexandre Julliard
julliard at winehq.org
Thu Apr 21 15:21:37 CDT 2022
Module: wine
Branch: master
Commit: 079b0423b5b2fe321b8cae76c61c1bc47b24ac64
URL: https://source.winehq.org/git/wine.git/?a=commit;h=079b0423b5b2fe321b8cae76c61c1bc47b24ac64
Author: Zebediah Figura <zfigura at codeweavers.com>
Date: Wed Apr 20 19:15:30 2022 -0500
user32: Update mouse tracking information based on the timer ID in DispatchMessage().
Avoid passing a callback to NtUserSetSystemTimer(); it does not support one.
Signed-off-by: Zebediah Figura <zfigura at codeweavers.com>
Signed-off-by: Jacek Caban <jacek at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
---
dlls/user32/input.c | 27 +++++++++------------------
dlls/user32/user_main.c | 1 +
dlls/user32/user_private.h | 1 +
dlls/win32u/message.c | 5 +++++
dlls/win32u/ntuser_private.h | 2 ++
5 files changed, 18 insertions(+), 18 deletions(-)
diff --git a/dlls/user32/input.c b/dlls/user32/input.c
index 5a1d82eb7a7..6c0eb82b04f 100644
--- a/dlls/user32/input.c
+++ b/dlls/user32/input.c
@@ -527,7 +527,6 @@ typedef struct __TRACKINGLIST {
/* FIXME: move tracking stuff into a per thread data */
static _TRACKINGLIST tracking_info;
-static UINT_PTR timer;
static void check_mouse_leave(HWND hwnd, int hittest)
{
@@ -564,13 +563,12 @@ static void check_mouse_leave(HWND hwnd, int hittest)
}
}
-static void CALLBACK TrackMouseEventProc(HWND hwnd, UINT uMsg, UINT_PTR idEvent,
- DWORD dwTime)
+void CDECL update_mouse_tracking_info( HWND hwnd )
{
POINT pos;
INT hoverwidth = 0, hoverheight = 0, hittest;
- TRACE("hwnd %p, msg %04x, id %04lx, time %u\n", hwnd, uMsg, idEvent, dwTime);
+ TRACE( "hwnd %p\n", hwnd );
GetCursorPos(&pos);
hwnd = WINPOS_WindowFromPoint(hwnd, pos, &hittest);
@@ -632,8 +630,7 @@ static void CALLBACK TrackMouseEventProc(HWND hwnd, UINT uMsg, UINT_PTR idEvent,
/* stop the timer if the tracking list is empty */
if (!(tracking_info.tme.dwFlags & (TME_HOVER | TME_LEAVE)))
{
- KillSystemTimer(tracking_info.tme.hwndTrack, timer);
- timer = 0;
+ KillSystemTimer( tracking_info.tme.hwndTrack, SYSTEM_TIMER_TRACK_MOUSE );
tracking_info.tme.hwndTrack = 0;
tracking_info.tme.dwFlags = 0;
tracking_info.tme.dwHoverTime = 0;
@@ -718,8 +715,7 @@ TrackMouseEvent (TRACKMOUSEEVENT *ptme)
/* if we aren't tracking on hover or leave remove this entry */
if (!(tracking_info.tme.dwFlags & (TME_HOVER | TME_LEAVE)))
{
- KillSystemTimer(tracking_info.tme.hwndTrack, timer);
- timer = 0;
+ KillSystemTimer( tracking_info.tme.hwndTrack, SYSTEM_TIMER_TRACK_MOUSE );
tracking_info.tme.hwndTrack = 0;
tracking_info.tme.dwFlags = 0;
tracking_info.tme.dwHoverTime = 0;
@@ -732,14 +728,10 @@ TrackMouseEvent (TRACKMOUSEEVENT *ptme)
if (tracking_info.tme.dwFlags & TME_LEAVE && tracking_info.tme.hwndTrack != NULL)
check_mouse_leave(hwnd, hittest);
- if (timer)
- {
- KillSystemTimer(tracking_info.tme.hwndTrack, timer);
- timer = 0;
- tracking_info.tme.hwndTrack = 0;
- tracking_info.tme.dwFlags = 0;
- tracking_info.tme.dwHoverTime = 0;
- }
+ KillSystemTimer( tracking_info.tme.hwndTrack, SYSTEM_TIMER_TRACK_MOUSE );
+ tracking_info.tme.hwndTrack = 0;
+ tracking_info.tme.dwFlags = 0;
+ tracking_info.tme.dwHoverTime = 0;
if (ptme->hwndTrack == hwnd)
{
@@ -750,8 +742,7 @@ TrackMouseEvent (TRACKMOUSEEVENT *ptme)
/* Initialize HoverInfo variables even if not hover tracking */
tracking_info.pos = pos;
- timer = NtUserSetSystemTimer( tracking_info.tme.hwndTrack, (UINT_PTR)&tracking_info.tme,
- hover_time, TrackMouseEventProc );
+ NtUserSetSystemTimer( tracking_info.tme.hwndTrack, SYSTEM_TIMER_TRACK_MOUSE, hover_time, NULL );
}
}
diff --git a/dlls/user32/user_main.c b/dlls/user32/user_main.c
index 6e0722e4750..08f2833ee3f 100644
--- a/dlls/user32/user_main.c
+++ b/dlls/user32/user_main.c
@@ -179,6 +179,7 @@ static const struct user_callbacks user_funcs =
SCROLL_SetStandardScrollPainted,
toggle_caret,
unpack_dde_message,
+ update_mouse_tracking_info,
register_imm,
unregister_imm,
};
diff --git a/dlls/user32/user_private.h b/dlls/user32/user_private.h
index 96c47a71753..54b11f2a8ef 100644
--- a/dlls/user32/user_private.h
+++ b/dlls/user32/user_private.h
@@ -100,6 +100,7 @@ extern void SYSPARAMS_Init(void) DECLSPEC_HIDDEN;
extern void USER_CheckNotLock(void) DECLSPEC_HIDDEN;
extern BOOL USER_IsExitingThread( DWORD tid ) DECLSPEC_HIDDEN;
extern void CDECL toggle_caret( HWND hwnd ) DECLSPEC_HIDDEN;
+extern void CDECL update_mouse_tracking_info( HWND hwnd ) DECLSPEC_HIDDEN;
typedef LRESULT (*winproc_callback_t)( HWND hwnd, UINT msg, WPARAM wp, LPARAM lp,
LRESULT *result, void *arg );
diff --git a/dlls/win32u/message.c b/dlls/win32u/message.c
index 7b3ad1d1f73..ba91d002d13 100644
--- a/dlls/win32u/message.c
+++ b/dlls/win32u/message.c
@@ -2477,6 +2477,11 @@ LRESULT dispatch_message( const MSG *msg, BOOL ansi )
if (!user_callbacks) break;
user_callbacks->toggle_caret( msg->hwnd );
return 0;
+
+ case SYSTEM_TIMER_TRACK_MOUSE:
+ if (!user_callbacks) break;
+ user_callbacks->update_mouse_tracking_info( msg->hwnd );
+ return 0;
}
}
diff --git a/dlls/win32u/ntuser_private.h b/dlls/win32u/ntuser_private.h
index 0ca4aef4868..604817708c7 100644
--- a/dlls/win32u/ntuser_private.h
+++ b/dlls/win32u/ntuser_private.h
@@ -54,6 +54,7 @@ struct user_callbacks
void (CDECL *toggle_caret)( HWND hwnd );
BOOL (CDECL *unpack_dde_message)( HWND hwnd, UINT message, WPARAM *wparam, LPARAM *lparam,
void **buffer, size_t size );
+ void (CDECL *update_mouse_tracking_info)( HWND hwnd );
BOOL (WINAPI *register_imm)( HWND hwnd );
void (WINAPI *unregister_imm)( HWND hwnd );
};
@@ -63,6 +64,7 @@ struct user_callbacks
enum system_timer_id
{
+ SYSTEM_TIMER_TRACK_MOUSE = 0xfffa,
SYSTEM_TIMER_CARET = 0xffff,
};
More information about the wine-cvs
mailing list