-
Notifications
You must be signed in to change notification settings - Fork 101
Expand file tree
/
Copy pathEnableMouseInPointer.patch
More file actions
98 lines (93 loc) · 3.94 KB
/
EnableMouseInPointer.patch
File metadata and controls
98 lines (93 loc) · 3.94 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
diff -ruN wine_11.0-rc2_staging/dlls/win32u/input.c wine_11.0-rc2_staging_MouseInPointer/dlls/win32u/input.c
--- wine_11.0-rc2_staging/dlls/win32u/input.c 2025-12-29 13:41:41.975181837 +0000
+++ wine_11.0-rc2_staging_MouseInPointer/dlls/win32u/input.c 2025-12-29 13:24:25.348886963 +0000
@@ -2594,9 +2594,14 @@
*/
BOOL WINAPI NtUserEnableMouseInPointer( BOOL enable )
{
- FIXME( "enable %u stub!\n", enable );
- RtlSetLastWin32Error( ERROR_CALL_NOT_IMPLEMENTED );
- return FALSE;
+ struct ntuser_thread_info *thread_info = NtUserGetThreadInfo();
+
+ if ( enable == TRUE )
+ thread_info->mouse_in_pointer = TRUE;
+ else
+ thread_info->mouse_in_pointer = FALSE;
+
+ return thread_info->mouse_in_pointer;
}
/**********************************************************************
@@ -2604,9 +2609,7 @@
*/
BOOL WINAPI NtUserEnableMouseInPointerForThread( void )
{
- FIXME( "stub!\n" );
- RtlSetLastWin32Error( ERROR_CALL_NOT_IMPLEMENTED );
- return FALSE;
+ return NtUserEnableMouseInPointer(TRUE);
}
/**********************************************************************
@@ -2614,9 +2617,9 @@
*/
BOOL WINAPI NtUserIsMouseInPointerEnabled(void)
{
- FIXME( "stub!\n" );
- RtlSetLastWin32Error( ERROR_CALL_NOT_IMPLEMENTED );
- return FALSE;
+ struct ntuser_thread_info *thread_info = NtUserGetThreadInfo();
+
+ return thread_info->mouse_in_pointer;
}
static BOOL is_captured_by_system(void)
diff -ruN wine_11.0-rc2_staging/dlls/win32u/message.c wine_11.0-rc2_staging_MouseInPointer/dlls/win32u/message.c
--- wine_11.0-rc2_staging/dlls/win32u/message.c 2025-12-29 13:41:40.573798712 +0000
+++ wine_11.0-rc2_staging_MouseInPointer/dlls/win32u/message.c 2025-12-29 13:54:08.510875628 +0000
@@ -4629,9 +4629,38 @@
return put_message_in_queue( &info, NULL );
}
+UINT isMouseButtonPressed = 0;
+
LRESULT WINAPI NtUserMessageCall( HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam,
void *result_info, DWORD type, BOOL ansi )
{
+ if ( type == NtUserGetDispatchParams &&
+ (msg == WM_LBUTTONDOWN || msg == WM_LBUTTONUP || msg == WM_MOUSEMOVE) ) {
+ struct ntuser_thread_info *thread_info = NtUserGetThreadInfo();
+
+ if ( thread_info->mouse_in_pointer == TRUE ) {
+ if ( msg == WM_LBUTTONDOWN ) {
+ wparam = MAKEWPARAM(1, POINTER_MESSAGE_FLAG_PRIMARY | POINTER_MESSAGE_FLAG_FIRSTBUTTON | POINTER_MESSAGE_FLAG_INCONTACT | POINTER_MESSAGE_FLAG_INRANGE);
+ isMouseButtonPressed = 1;
+ }
+
+ if ( msg == WM_LBUTTONUP ) {
+ wparam = MAKEWPARAM(1, POINTER_MESSAGE_FLAG_PRIMARY | POINTER_MESSAGE_FLAG_INRANGE);
+ isMouseButtonPressed = 0;
+ }
+
+ if ( msg == WM_MOUSEMOVE ) {
+ if ( isMouseButtonPressed ) {
+ wparam = MAKEWPARAM(1, POINTER_MESSAGE_FLAG_PRIMARY | POINTER_MESSAGE_FLAG_FIRSTBUTTON | POINTER_MESSAGE_FLAG_INCONTACT | POINTER_MESSAGE_FLAG_INRANGE);
+ } else {
+ wparam = MAKEWPARAM(1, POINTER_MESSAGE_FLAG_PRIMARY | POINTER_MESSAGE_FLAG_INRANGE);
+ }
+ }
+
+ msg = WM_POINTERUPDATE;
+ }
+ }
+
switch (type)
{
case NtUserScrollBarWndProc:
diff -ruN wine_11.0-rc2_staging/include/ntuser.h wine_11.0-rc2_staging_MouseInPointer/include/ntuser.h
--- wine_11.0-rc2_staging/include/ntuser.h 2025-12-29 13:41:41.963567359 +0000
+++ wine_11.0-rc2_staging_MouseInPointer/include/ntuser.h 2025-12-29 13:24:31.452997883 +0000
@@ -134,6 +134,7 @@
UINT default_imc; /* default input context */
UINT64 client_imm; /* client IMM thread info */
UINT64 wmchar_data; /* client data for WM_CHAR mappings */
+ BOOL mouse_in_pointer;
};
static inline struct ntuser_thread_info *NtUserGetThreadInfo(void)