diff --git a/patches/patchinstall.sh b/patches/patchinstall.sh index ef520a47..b180a6eb 100755 --- a/patches/patchinstall.sh +++ b/patches/patchinstall.sh @@ -1621,13 +1621,6 @@ if test "$enable_user32_rawinput_hid" -eq 1; then enable_user32_rawinput_nolegacy=1 fi -if test "$enable_user32_rawinput_nolegacy" -eq 1; then - if test "$enable_user32_rawinput_mouse" -gt 1; then - abort "Patchset user32-rawinput-mouse disabled, but user32-rawinput-nolegacy depends on that." - fi - enable_user32_rawinput_mouse=1 -fi - if test "$enable_stdole32_tlb_SLTG_Typelib" -eq 1; then if test "$enable_widl_SLTG_Typelib_Support" -gt 1; then abort "Patchset widl-SLTG_Typelib_Support disabled, but stdole32.tlb-SLTG_Typelib depends on that." @@ -1851,17 +1844,6 @@ if test "$enable_eventfd_synchronization" -eq 1; then enable_ws2_32_WSACleanup=1 fi -if test "$enable_user32_rawinput_mouse" -eq 1; then - if test "$enable_loader_KeyboardLayouts" -gt 1; then - abort "Patchset loader-KeyboardLayouts disabled, but user32-rawinput-mouse depends on that." - fi - if test "$enable_winex11_drv_mouse_coorrds" -gt 1; then - abort "Patchset winex11.drv-mouse-coorrds disabled, but user32-rawinput-mouse depends on that." - fi - enable_loader_KeyboardLayouts=1 - enable_winex11_drv_mouse_coorrds=1 -fi - if test "$enable_server_Shared_Memory" -eq 1; then if test "$enable_ntdll_Threading" -gt 1; then abort "Patchset ntdll-Threading disabled, but server-Shared_Memory depends on that." @@ -1875,10 +1857,36 @@ if test "$enable_server_Shared_Memory" -eq 1; then if test "$enable_server_Signal_Thread" -gt 1; then abort "Patchset server-Signal_Thread disabled, but server-Shared_Memory depends on that." fi + if test "$enable_user32_rawinput_nolegacy" -gt 1; then + abort "Patchset user32-rawinput-nolegacy disabled, but server-Shared_Memory depends on that." + fi enable_ntdll_Threading=1 enable_server_Key_State=1 enable_server_PeekMessage=1 enable_server_Signal_Thread=1 + enable_user32_rawinput_nolegacy=1 +fi + +if test "$enable_user32_rawinput_nolegacy" -eq 1; then + if test "$enable_server_Key_State" -gt 1; then + abort "Patchset server-Key_State disabled, but user32-rawinput-nolegacy depends on that." + fi + if test "$enable_user32_rawinput_mouse" -gt 1; then + abort "Patchset user32-rawinput-mouse disabled, but user32-rawinput-nolegacy depends on that." + fi + enable_server_Key_State=1 + enable_user32_rawinput_mouse=1 +fi + +if test "$enable_user32_rawinput_mouse" -eq 1; then + if test "$enable_loader_KeyboardLayouts" -gt 1; then + abort "Patchset loader-KeyboardLayouts disabled, but user32-rawinput-mouse depends on that." + fi + if test "$enable_winex11_drv_mouse_coorrds" -gt 1; then + abort "Patchset winex11.drv-mouse-coorrds disabled, but user32-rawinput-mouse depends on that." + fi + enable_loader_KeyboardLayouts=1 + enable_winex11_drv_mouse_coorrds=1 fi if test "$enable_server_Realtime_Priority" -eq 1; then @@ -3525,38 +3533,6 @@ if test "$enable_server_Signal_Thread" -eq 1; then ) >> "$patchlist" fi -# Patchset server-Shared_Memory -# | -# | This patchset has the following (direct or indirect) dependencies: -# | * ntdll-Threading, server-Key_State, server-PeekMessage, server-Signal_Thread -# | -# | Modified files: -# | * dlls/ntdll/ntdll_misc.h, dlls/ntdll/server.c, dlls/ntdll/thread.c, dlls/ntdll/virtual.c, dlls/user32/focus.c, -# | dlls/user32/input.c, dlls/user32/message.c, dlls/user32/user_private.h, include/wine/server.h, include/winternl.h, -# | server/fd.c, server/file.h, server/main.c, server/mapping.c, server/protocol.def, server/queue.c, server/thread.c, -# | server/thread.h -# | -if test "$enable_server_Shared_Memory" -eq 1; then - patch_apply server-Shared_Memory/0001-ntdll-Implement-virtual_map_shared_memory.patch - patch_apply server-Shared_Memory/0002-server-Implement-support-for-global-and-local-shared.patch - patch_apply server-Shared_Memory/0003-user32-Get-rid-of-wineserver-call-for-GetInputState.patch - patch_apply server-Shared_Memory/0004-user32-Avoid-unnecessary-wineserver-calls-in-PeekMes.patch - patch_apply server-Shared_Memory/0005-user32-Get-rid-of-wineserver-call-for-GetLastInputIn.patch - patch_apply server-Shared_Memory/0006-ntdll-Only-enable-wineserver-shared-memory-communica.patch - patch_apply server-Shared_Memory/0007-server-Store-a-list-of-associated-queues-for-each-th.patch - patch_apply server-Shared_Memory/0008-user32-Get-rid-of-wineserver-call-for-GetActiveWindo.patch - ( - printf '%s\n' '+ { "Sebastian Lackner", "ntdll: Implement virtual_map_shared_memory.", 1 },'; - printf '%s\n' '+ { "Michael Müller", "server: Implement support for global and local shared memory blocks based on memfd.", 1 },'; - printf '%s\n' '+ { "Sebastian Lackner", "user32: Get rid of wineserver call for GetInputState.", 1 },'; - printf '%s\n' '+ { "Sebastian Lackner", "user32: Avoid unnecessary wineserver calls in PeekMessage/GetMessage.", 1 },'; - printf '%s\n' '+ { "Michael Müller", "user32: Get rid of wineserver call for GetLastInputInfo.", 1 },'; - printf '%s\n' '+ { "Sebastian Lackner", "ntdll: Only enable wineserver shared memory communication when a special environment variable is set.", 1 },'; - printf '%s\n' '+ { "Sebastian Lackner", "server: Store a list of associated queues for each thread input.", 1 },'; - printf '%s\n' '+ { "Sebastian Lackner", "user32: Get rid of wineserver call for GetActiveWindow, GetFocus, GetCapture.", 1 },'; - ) >> "$patchlist" -fi - # Patchset loader-KeyboardLayouts # | # | This patchset fixes the following Wine bugs: @@ -3635,6 +3611,64 @@ if test "$enable_user32_rawinput_mouse" -eq 1; then ) >> "$patchlist" fi +# Patchset user32-rawinput-nolegacy +# | +# | This patchset has the following (direct or indirect) dependencies: +# | * server-Key_State, loader-KeyboardLayouts, winex11.drv-mouse-coorrds, user32-rawinput-mouse +# | +# | Modified files: +# | * dlls/dinput/dinput_main.c, dlls/dinput8/tests/device.c, dlls/user32/rawinput.c, server/queue.c +# | +if test "$enable_user32_rawinput_nolegacy" -eq 1; then + patch_apply user32-rawinput-nolegacy/0001-dinput8-tests-Add-test-for-DISCL_EXCLUSIVE-flag-inte.patch + patch_apply user32-rawinput-nolegacy/0002-user32-Add-support-for-RIDEV_NOLEGACY-flag-in-Regist.patch + patch_apply user32-rawinput-nolegacy/0003-dinput-Set-RIDEV_INPUTSINK-flag-only-when-DISCL_BACK.patch + patch_apply user32-rawinput-nolegacy/0004-dinput-Set-correct-rawinput-flags-for-DISCL_EXCLUSIV.patch + patch_apply user32-rawinput-nolegacy/0005-server-Update-desktop-cursor-pos-even-if-RIDEV_NOLEG.patch + patch_apply user32-rawinput-nolegacy/0006-server-Also-update-the-key-state-if-RIDEV_NOLEGACY-i.patch + ( + printf '%s\n' '+ { "Rémi Bernon", "dinput8/tests: Add test for DISCL_EXCLUSIVE flag interaction with rawinput.", 1 },'; + printf '%s\n' '+ { "Derek Lesho", "user32: Add support for RIDEV_NOLEGACY flag in RegisterRawInputDevices.", 1 },'; + printf '%s\n' '+ { "Rémi Bernon", "dinput: Set RIDEV_INPUTSINK flag only when DISCL_BACKGROUND is requested.", 1 },'; + printf '%s\n' '+ { "Rémi Bernon", "dinput: Set correct rawinput flags for DISCL_EXCLUSIVE.", 1 },'; + printf '%s\n' '+ { "Rémi Bernon", "server: Update desktop cursor pos even if RIDEV_NOLEGACY flag is set.", 1 },'; + printf '%s\n' '+ { "Rémi Bernon", "server: Also update the key state if RIDEV_NOLEGACY is used.", 1 },'; + ) >> "$patchlist" +fi + +# Patchset server-Shared_Memory +# | +# | This patchset has the following (direct or indirect) dependencies: +# | * ntdll-Threading, server-Key_State, server-PeekMessage, server-Signal_Thread, loader-KeyboardLayouts, winex11.drv-mouse- +# | coorrds, user32-rawinput-mouse, user32-rawinput-nolegacy +# | +# | Modified files: +# | * dlls/ntdll/ntdll_misc.h, dlls/ntdll/server.c, dlls/ntdll/thread.c, dlls/ntdll/virtual.c, dlls/user32/focus.c, +# | dlls/user32/input.c, dlls/user32/message.c, dlls/user32/user_private.h, include/wine/server.h, include/winternl.h, +# | server/fd.c, server/file.h, server/main.c, server/mapping.c, server/protocol.def, server/queue.c, server/thread.c, +# | server/thread.h +# | +if test "$enable_server_Shared_Memory" -eq 1; then + patch_apply server-Shared_Memory/0001-ntdll-Implement-virtual_map_shared_memory.patch + patch_apply server-Shared_Memory/0002-server-Implement-support-for-global-and-local-shared.patch + patch_apply server-Shared_Memory/0003-user32-Get-rid-of-wineserver-call-for-GetInputState.patch + patch_apply server-Shared_Memory/0004-user32-Avoid-unnecessary-wineserver-calls-in-PeekMes.patch + patch_apply server-Shared_Memory/0005-user32-Get-rid-of-wineserver-call-for-GetLastInputIn.patch + patch_apply server-Shared_Memory/0006-ntdll-Only-enable-wineserver-shared-memory-communica.patch + patch_apply server-Shared_Memory/0007-server-Store-a-list-of-associated-queues-for-each-th.patch + patch_apply server-Shared_Memory/0008-user32-Get-rid-of-wineserver-call-for-GetActiveWindo.patch + ( + printf '%s\n' '+ { "Sebastian Lackner", "ntdll: Implement virtual_map_shared_memory.", 1 },'; + printf '%s\n' '+ { "Michael Müller", "server: Implement support for global and local shared memory blocks based on memfd.", 1 },'; + printf '%s\n' '+ { "Sebastian Lackner", "user32: Get rid of wineserver call for GetInputState.", 1 },'; + printf '%s\n' '+ { "Sebastian Lackner", "user32: Avoid unnecessary wineserver calls in PeekMessage/GetMessage.", 1 },'; + printf '%s\n' '+ { "Michael Müller", "user32: Get rid of wineserver call for GetLastInputInfo.", 1 },'; + printf '%s\n' '+ { "Sebastian Lackner", "ntdll: Only enable wineserver shared memory communication when a special environment variable is set.", 1 },'; + printf '%s\n' '+ { "Sebastian Lackner", "server: Store a list of associated queues for each thread input.", 1 },'; + printf '%s\n' '+ { "Sebastian Lackner", "user32: Get rid of wineserver call for GetActiveWindow, GetFocus, GetCapture.", 1 },'; + ) >> "$patchlist" +fi + # Patchset ws2_32-WSACleanup # | # | This patchset fixes the following Wine bugs: @@ -3659,8 +3693,8 @@ fi # | * Staging, advapi32-CreateRestrictedToken, advapi32-Token_Integrity_Level, kernel32-K32GetPerformanceInfo, ntdll- # | Junction_Points, ntdll-ThreadTime, ntdll-Hide_Wine_Exports, ntdll-User_Shared_Data, winebuild-Fake_Dlls, ntdll- # | RtlCreateUserThread, ntdll-SystemRoot_Symlink, server-Realtime_Priority, ntdll-Threading, server-Key_State, server- -# | PeekMessage, server-Signal_Thread, server-Shared_Memory, loader-KeyboardLayouts, winex11.drv-mouse-coorrds, user32 -# | -rawinput-mouse, ws2_32-WSACleanup +# | PeekMessage, server-Signal_Thread, loader-KeyboardLayouts, winex11.drv-mouse-coorrds, user32-rawinput-mouse, user32 +# | -rawinput-nolegacy, server-Shared_Memory, ws2_32-WSACleanup # | # | This patchset fixes the following Wine bugs: # | * [#36692] Many multi-threaded applications have poor performance due to heavy use of synchronization primitives @@ -5376,8 +5410,8 @@ fi # | * Staging, advapi32-CreateRestrictedToken, advapi32-Token_Integrity_Level, kernel32-K32GetPerformanceInfo, ntdll- # | Junction_Points, ntdll-ThreadTime, ntdll-Hide_Wine_Exports, ntdll-User_Shared_Data, winebuild-Fake_Dlls, ntdll- # | RtlCreateUserThread, ntdll-SystemRoot_Symlink, server-Realtime_Priority, ntdll-Threading, server-Key_State, server- -# | PeekMessage, server-Signal_Thread, server-Shared_Memory, loader-KeyboardLayouts, winex11.drv-mouse-coorrds, user32 -# | -rawinput-mouse, ws2_32-WSACleanup, eventfd_synchronization +# | PeekMessage, server-Signal_Thread, loader-KeyboardLayouts, winex11.drv-mouse-coorrds, user32-rawinput-mouse, user32 +# | -rawinput-nolegacy, server-Shared_Memory, ws2_32-WSACleanup, eventfd_synchronization # | # | This patchset fixes the following Wine bugs: # | * [#46967] GOG Galaxy doesn't run in virtual desktop. @@ -5465,7 +5499,8 @@ fi # Patchset server-Object_Types # | # | This patchset has the following (direct or indirect) dependencies: -# | * ntdll-Threading, server-Key_State, server-PeekMessage, server-Signal_Thread, server-Shared_Memory +# | * ntdll-Threading, server-Key_State, server-PeekMessage, server-Signal_Thread, loader-KeyboardLayouts, winex11.drv-mouse- +# | coorrds, user32-rawinput-mouse, user32-rawinput-nolegacy, server-Shared_Memory # | # | This patchset fixes the following Wine bugs: # | * [#44629] Process Hacker can't enumerate handles @@ -6186,33 +6221,10 @@ if test "$enable_user32_msgbox_Support_WM_COPY_mesg" -eq 1; then ) >> "$patchlist" fi -# Patchset user32-rawinput-nolegacy -# | -# | This patchset has the following (direct or indirect) dependencies: -# | * loader-KeyboardLayouts, winex11.drv-mouse-coorrds, user32-rawinput-mouse -# | -# | Modified files: -# | * dlls/dinput/dinput_main.c, dlls/dinput8/tests/device.c, dlls/user32/rawinput.c, server/queue.c -# | -if test "$enable_user32_rawinput_nolegacy" -eq 1; then - patch_apply user32-rawinput-nolegacy/0001-dinput8-tests-Add-test-for-DISCL_EXCLUSIVE-flag-inte.patch - patch_apply user32-rawinput-nolegacy/0002-user32-Add-support-for-RIDEV_NOLEGACY-flag-in-Regist.patch - patch_apply user32-rawinput-nolegacy/0003-dinput-Set-RIDEV_INPUTSINK-flag-only-when-DISCL_BACK.patch - patch_apply user32-rawinput-nolegacy/0004-dinput-Set-correct-rawinput-flags-for-DISCL_EXCLUSIV.patch - patch_apply user32-rawinput-nolegacy/0005-server-Update-desktop-cursor-pos-even-if-RIDEV_NOLEG.patch - ( - printf '%s\n' '+ { "Rémi Bernon", "dinput8/tests: Add test for DISCL_EXCLUSIVE flag interaction with rawinput.", 1 },'; - printf '%s\n' '+ { "Derek Lesho", "user32: Add support for RIDEV_NOLEGACY flag in RegisterRawInputDevices.", 1 },'; - printf '%s\n' '+ { "Rémi Bernon", "dinput: Set RIDEV_INPUTSINK flag only when DISCL_BACKGROUND is requested.", 1 },'; - printf '%s\n' '+ { "Rémi Bernon", "dinput: Set correct rawinput flags for DISCL_EXCLUSIVE.", 1 },'; - printf '%s\n' '+ { "Rémi Bernon", "server: Update desktop cursor pos even if RIDEV_NOLEGACY flag is set.", 1 },'; - ) >> "$patchlist" -fi - # Patchset user32-rawinput-hid # | # | This patchset has the following (direct or indirect) dependencies: -# | * loader-KeyboardLayouts, winex11.drv-mouse-coorrds, user32-rawinput-mouse, user32-rawinput-nolegacy +# | * server-Key_State, loader-KeyboardLayouts, winex11.drv-mouse-coorrds, user32-rawinput-mouse, user32-rawinput-nolegacy # | # | Modified files: # | * dlls/hidclass.sys/device.c, dlls/hidclass.sys/hid.h, dlls/hidclass.sys/pnp.c, dlls/user32/message.c, @@ -6236,7 +6248,7 @@ fi # Patchset user32-rawinput-mouse-experimental # | # | This patchset has the following (direct or indirect) dependencies: -# | * loader-KeyboardLayouts, winex11.drv-mouse-coorrds, user32-rawinput-mouse, user32-rawinput-nolegacy +# | * server-Key_State, loader-KeyboardLayouts, winex11.drv-mouse-coorrds, user32-rawinput-mouse, user32-rawinput-nolegacy # | # | This patchset fixes the following Wine bugs: # | * [#45882] - Raw Input should use untransformed mouse values (affects Overwatch, several Source games). @@ -7235,8 +7247,8 @@ fi # | * Staging, advapi32-CreateRestrictedToken, advapi32-Token_Integrity_Level, kernel32-K32GetPerformanceInfo, ntdll- # | Junction_Points, ntdll-ThreadTime, ntdll-Hide_Wine_Exports, ntdll-User_Shared_Data, winebuild-Fake_Dlls, ntdll- # | RtlCreateUserThread, ntdll-SystemRoot_Symlink, server-Realtime_Priority, ntdll-Threading, server-Key_State, server- -# | PeekMessage, server-Signal_Thread, server-Shared_Memory, loader-KeyboardLayouts, winex11.drv-mouse-coorrds, user32 -# | -rawinput-mouse, ws2_32-WSACleanup, eventfd_synchronization, server-Desktop_Refcount +# | PeekMessage, server-Signal_Thread, loader-KeyboardLayouts, winex11.drv-mouse-coorrds, user32-rawinput-mouse, user32 +# | -rawinput-nolegacy, server-Shared_Memory, ws2_32-WSACleanup, eventfd_synchronization, server-Desktop_Refcount # | # | Modified files: # | * dlls/ws2_32/socket.c, dlls/ws2_32/tests/sock.c, include/winsock.h, server/protocol.def, server/sock.c diff --git a/patches/server-Shared_Memory/0005-user32-Get-rid-of-wineserver-call-for-GetLastInputIn.patch b/patches/server-Shared_Memory/0005-user32-Get-rid-of-wineserver-call-for-GetLastInputIn.patch index aa1e8fd9..e4afbfb9 100644 --- a/patches/server-Shared_Memory/0005-user32-Get-rid-of-wineserver-call-for-GetLastInputIn.patch +++ b/patches/server-Shared_Memory/0005-user32-Get-rid-of-wineserver-call-for-GetLastInputIn.patch @@ -1,7 +1,7 @@ -From 805c26a06412e2af19483976a8a9a892267f29d9 Mon Sep 17 00:00:00 2001 +From f98d2efae94053cf8b7f817c2d6d77297fbbd757 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20M=C3=BCller?= Date: Thu, 19 Mar 2015 02:18:37 +0100 -Subject: user32: Get rid of wineserver call for GetLastInputInfo. +Subject: [PATCH] user32: Get rid of wineserver call for GetLastInputInfo. --- dlls/user32/input.c | 7 +++++++ @@ -10,10 +10,10 @@ Subject: user32: Get rid of wineserver call for GetLastInputInfo. 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/dlls/user32/input.c b/dlls/user32/input.c -index 4cf6b61..e63c8cf 100644 +index d9ecc25e4d2..11c38226624 100644 --- a/dlls/user32/input.c +++ b/dlls/user32/input.c -@@ -487,6 +487,7 @@ done: +@@ -510,6 +510,7 @@ done: BOOL WINAPI GetLastInputInfo(PLASTINPUTINFO plii) { BOOL ret; @@ -21,7 +21,7 @@ index 4cf6b61..e63c8cf 100644 TRACE("%p\n", plii); -@@ -496,6 +497,12 @@ BOOL WINAPI GetLastInputInfo(PLASTINPUTINFO plii) +@@ -519,6 +520,12 @@ BOOL WINAPI GetLastInputInfo(PLASTINPUTINFO plii) return FALSE; } @@ -35,7 +35,7 @@ index 4cf6b61..e63c8cf 100644 { ret = !wine_server_call_err( req ); diff --git a/server/protocol.def b/server/protocol.def -index 4872251..f12109f 100644 +index 6a9553bf34a..18350905457 100644 --- a/server/protocol.def +++ b/server/protocol.def @@ -71,12 +71,12 @@ struct request_max_size @@ -54,17 +54,17 @@ index 4872251..f12109f 100644 /* debug event data */ diff --git a/server/queue.c b/server/queue.c -index 3d0fef2..37e8c37 100644 +index d7c0f7178ec..337bdf3b044 100644 --- a/server/queue.c +++ b/server/queue.c -@@ -1490,6 +1490,7 @@ static void queue_hardware_message( struct desktop *desktop, struct message *msg +@@ -1600,6 +1600,7 @@ static void queue_hardware_message( struct desktop *desktop, struct message *msg - update_key_state( desktop, desktop->keystate, msg ); + update_key_state( desktop, desktop->keystate, msg->msg, msg->wparam ); last_input_time = get_tick_count(); + if (shmglobal) shmglobal->last_input_time = last_input_time; if (msg->msg != WM_MOUSEMOVE) always_queue = 1; if (is_keyboard_msg( msg )) -- -2.3.5 +2.26.0 diff --git a/patches/server-Shared_Memory/definition b/patches/server-Shared_Memory/definition index 0e6bd7e4..80ccfe59 100644 --- a/patches/server-Shared_Memory/definition +++ b/patches/server-Shared_Memory/definition @@ -5,3 +5,4 @@ Depends: ntdll-Threading Depends: server-Key_State Depends: server-PeekMessage Depends: server-Signal_Thread +Depends: user32-rawinput-nolegacy diff --git a/patches/user32-rawinput-nolegacy/0006-server-Also-update-the-key-state-if-RIDEV_NOLEGACY-i.patch b/patches/user32-rawinput-nolegacy/0006-server-Also-update-the-key-state-if-RIDEV_NOLEGACY-i.patch new file mode 100644 index 00000000..04483542 --- /dev/null +++ b/patches/user32-rawinput-nolegacy/0006-server-Also-update-the-key-state-if-RIDEV_NOLEGACY-i.patch @@ -0,0 +1,106 @@ +From 5406b7b15cae43cbe023492f518436c6990871f5 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?R=C3=A9mi=20Bernon?= +Date: Fri, 27 Mar 2020 16:25:14 +0100 +Subject: [PATCH] server: Also update the key state if RIDEV_NOLEGACY is used. + +--- + server/queue.c | 40 ++++++++++++++++++++++++++++++++-------- + 1 file changed, 32 insertions(+), 8 deletions(-) + +diff --git a/server/queue.c b/server/queue.c +index 7262d6201f4..5621e393dd8 100644 +--- a/server/queue.c ++++ b/server/queue.c +@@ -1310,12 +1310,12 @@ static void set_input_key_state( unsigned char *keystate, unsigned char key, int + + /* update the key state for a keyboard message */ + static void update_key_state( struct desktop *desktop, unsigned char *keystate, +- const struct message *msg ) ++ unsigned int msg, lparam_t wparam ) + { + unsigned char key; + int down = 0; + +- switch (msg->msg) ++ switch (msg) + { + case WM_LBUTTONDOWN: + down = (keystate == desktop->keystate) ? 0xc0 : 0x80; +@@ -1339,8 +1339,8 @@ static void update_key_state( struct desktop *desktop, unsigned char *keystate, + down = (keystate == desktop->keystate) ? 0xc0 : 0x80; + /* fall through */ + case WM_XBUTTONUP: +- if (msg->wparam >> 16 == XBUTTON1) set_input_key_state( keystate, VK_XBUTTON1, down ); +- else if (msg->wparam >> 16 == XBUTTON2) set_input_key_state( keystate, VK_XBUTTON2, down ); ++ if (wparam >> 16 == XBUTTON1) set_input_key_state( keystate, VK_XBUTTON1, down ); ++ else if (wparam >> 16 == XBUTTON2) set_input_key_state( keystate, VK_XBUTTON2, down ); + break; + case WM_KEYDOWN: + case WM_SYSKEYDOWN: +@@ -1348,7 +1348,7 @@ static void update_key_state( struct desktop *desktop, unsigned char *keystate, + /* fall through */ + case WM_KEYUP: + case WM_SYSKEYUP: +- key = (unsigned char)msg->wparam; ++ key = (unsigned char)wparam; + set_input_key_state( keystate, key, down ); + switch(key) + { +@@ -1392,11 +1392,35 @@ static void synchronize_input_key_state( struct thread_input *input ) + } + } + ++/* update the desktop key state according to a mouse message flags */ ++static void update_desktop_mouse_state( struct desktop *desktop, unsigned int flags, ++ int x, int y, lparam_t wparam ) ++{ ++ if (flags & MOUSEEVENTF_MOVE) ++ update_desktop_cursor_pos( desktop, x, y ); ++ if (flags & MOUSEEVENTF_LEFTDOWN) ++ update_key_state( desktop, desktop->keystate, WM_LBUTTONDOWN, wparam ); ++ if (flags & MOUSEEVENTF_LEFTUP) ++ update_key_state( desktop, desktop->keystate, WM_LBUTTONUP, wparam ); ++ if (flags & MOUSEEVENTF_RIGHTDOWN) ++ update_key_state( desktop, desktop->keystate, WM_RBUTTONDOWN, wparam ); ++ if (flags & MOUSEEVENTF_RIGHTUP) ++ update_key_state( desktop, desktop->keystate, WM_RBUTTONUP, wparam ); ++ if (flags & MOUSEEVENTF_MIDDLEDOWN) ++ update_key_state( desktop, desktop->keystate, WM_MBUTTONDOWN, wparam ); ++ if (flags & MOUSEEVENTF_MIDDLEUP) ++ update_key_state( desktop, desktop->keystate, WM_MBUTTONUP, wparam ); ++ if (flags & MOUSEEVENTF_XDOWN) ++ update_key_state( desktop, desktop->keystate, WM_XBUTTONDOWN, wparam ); ++ if (flags & MOUSEEVENTF_XUP) ++ update_key_state( desktop, desktop->keystate, WM_XBUTTONUP, wparam ); ++} ++ + /* update the thread input key state for a keyboard message */ + static void update_input_key_state( struct thread_input *input, const struct message *msg ) + { + synchronize_input_key_state( input ); +- update_key_state( input->desktop, input->keystate, msg ); ++ update_key_state( input->desktop, input->keystate, msg->msg, msg->wparam ); + } + + /* release the hardware message currently being processed by the given thread */ +@@ -1548,7 +1572,7 @@ static void queue_hardware_message( struct desktop *desktop, struct message *msg + struct thread_input *input; + unsigned int msg_code; + +- update_key_state( desktop, desktop->keystate, msg ); ++ update_key_state( desktop, desktop->keystate, msg->msg, msg->wparam ); + last_input_time = get_tick_count(); + if (msg->msg != WM_MOUSEMOVE) always_queue = 1; + +@@ -1796,7 +1820,7 @@ static int queue_mouse_message( struct desktop *desktop, user_handle_t win, cons + return 0; + if ((device = current->process->rawinput_mouse) && (device->flags & RIDEV_NOLEGACY)) + { +- if (flags & MOUSEEVENTF_MOVE) update_desktop_cursor_pos( desktop, x, y ); ++ update_desktop_mouse_state( desktop, flags, x, y, input->mouse.data << 16 ); + return 0; + } + +-- +2.26.0 + diff --git a/patches/user32-rawinput-nolegacy/definition b/patches/user32-rawinput-nolegacy/definition index efc2784e..9fa66dd2 100644 --- a/patches/user32-rawinput-nolegacy/definition +++ b/patches/user32-rawinput-nolegacy/definition @@ -1 +1,2 @@ Depends: user32-rawinput-mouse +Depends: server-Key_State