mirror of
https://gitlab.winehq.org/wine/wine-staging.git
synced 2025-01-28 22:04:43 -08:00
dinput-Events: Update patchset and avoid wine internal exports in user32.
This commit is contained in:
parent
bfabcd117e
commit
9b1ac08c87
@ -1,8 +1,8 @@
|
||||
From 0bf1b2a338baca121228b1739a2398f34a5fbd86 Mon Sep 17 00:00:00 2001
|
||||
From 278d2cd8f466e786bed9fa4a621d627c20c83b8d Mon Sep 17 00:00:00 2001
|
||||
From: Sebastian Lackner <sebastian@fds-team.de>
|
||||
Date: Thu, 18 Dec 2014 01:04:34 +0100
|
||||
Subject: dinput: Ensure X11 input events are handled even without explicit
|
||||
message loop. (try 3)
|
||||
message loop. (v4)
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
@ -30,17 +30,14 @@ call __wine_check_for_events from multiple locations in the code. See:
|
||||
* https://bugs.wine-staging.com/show_bug.cgi?id=42
|
||||
* https://bugs.wine-staging.com/show_bug.cgi?id=149
|
||||
---
|
||||
dlls/dinput/device.c | 5 +++--
|
||||
dlls/dinput/keyboard.c | 2 ++
|
||||
dlls/dinput/mouse.c | 2 ++
|
||||
dlls/dinput/tests/mouse.c | 2 ++
|
||||
dlls/user32/input.c | 14 ++++++++++----
|
||||
dlls/user32/user32.spec | 1 +
|
||||
include/winuser.h | 1 +
|
||||
7 files changed, 21 insertions(+), 6 deletions(-)
|
||||
dlls/dinput/device.c | 5 +++--
|
||||
dlls/dinput/keyboard.c | 2 ++
|
||||
dlls/dinput/mouse.c | 2 ++
|
||||
dlls/dinput/tests/mouse.c | 2 ++
|
||||
4 files changed, 9 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/dlls/dinput/device.c b/dlls/dinput/device.c
|
||||
index ab43029..60678be 100644
|
||||
index ab43029..501eae8 100644
|
||||
--- a/dlls/dinput/device.c
|
||||
+++ b/dlls/dinput/device.c
|
||||
@@ -1631,8 +1631,9 @@ HRESULT WINAPI IDirectInputDevice2WImpl_Poll(LPDIRECTINPUTDEVICE8W iface)
|
||||
@ -50,33 +47,33 @@ index ab43029..60678be 100644
|
||||
- /* Because wine devices do not need to be polled, just return DI_NOEFFECT */
|
||||
- return DI_NOEFFECT;
|
||||
+
|
||||
+ __wine_check_for_events( QS_ALLINPUT );
|
||||
+ MsgWaitForMultipleObjectsEx(0, NULL, 0, QS_ALLINPUT, 0);
|
||||
+ return DI_OK;
|
||||
}
|
||||
|
||||
HRESULT WINAPI IDirectInputDevice2AImpl_Poll(LPDIRECTINPUTDEVICE8A iface)
|
||||
diff --git a/dlls/dinput/keyboard.c b/dlls/dinput/keyboard.c
|
||||
index f3ac30e..4b4ccf4 100644
|
||||
index f3ac30e..1e273f6 100644
|
||||
--- a/dlls/dinput/keyboard.c
|
||||
+++ b/dlls/dinput/keyboard.c
|
||||
@@ -335,6 +335,8 @@ static HRESULT WINAPI SysKeyboardWImpl_GetDeviceState(LPDIRECTINPUTDEVICE8W ifac
|
||||
if (len != This->base.data_format.user_df->dwDataSize )
|
||||
return DIERR_INVALIDPARAM;
|
||||
|
||||
+ __wine_check_for_events( QS_ALLINPUT );
|
||||
+ MsgWaitForMultipleObjectsEx(0, NULL, 0, QS_ALLINPUT, 0);
|
||||
+
|
||||
EnterCriticalSection(&This->base.crit);
|
||||
|
||||
if (TRACE_ON(dinput)) {
|
||||
diff --git a/dlls/dinput/mouse.c b/dlls/dinput/mouse.c
|
||||
index 132efce..44e1d57 100644
|
||||
index 132efce..8126c1e 100644
|
||||
--- a/dlls/dinput/mouse.c
|
||||
+++ b/dlls/dinput/mouse.c
|
||||
@@ -552,6 +552,8 @@ static HRESULT WINAPI SysMouseWImpl_GetDeviceState(LPDIRECTINPUTDEVICE8W iface,
|
||||
|
||||
if(This->base.acquired == 0) return DIERR_NOTACQUIRED;
|
||||
|
||||
+ __wine_check_for_events( QS_ALLINPUT );
|
||||
+ MsgWaitForMultipleObjectsEx(0, NULL, 0, QS_ALLINPUT, 0);
|
||||
+
|
||||
TRACE("(this=%p,0x%08x,%p):\n", This, len, ptr);
|
||||
_dump_mouse_state(&This->m_state);
|
||||
@ -101,80 +98,6 @@ index 1a5f4bc..711abcf 100644
|
||||
ok(hr == DI_OK && cnt == 1, "GetDeviceData() failed: %08x cnt:%d\n", hr, cnt);
|
||||
|
||||
if (pMouse) IUnknown_Release(pMouse);
|
||||
diff --git a/dlls/user32/input.c b/dlls/user32/input.c
|
||||
index 40e35a9..0ce64fc 100644
|
||||
--- a/dlls/user32/input.c
|
||||
+++ b/dlls/user32/input.c
|
||||
@@ -354,12 +354,18 @@ HWND WINAPI GetCapture(void)
|
||||
}
|
||||
|
||||
|
||||
-static void check_for_events( UINT flags )
|
||||
+/***********************************************************************
|
||||
+ * __wine_check_for_events (USER32.@)
|
||||
+ *
|
||||
+ * Internal function to check for pending X11 events.
|
||||
+ */
|
||||
+void CDECL __wine_check_for_events( UINT flags )
|
||||
{
|
||||
if (USER_Driver->pMsgWaitForMultipleObjectsEx( 0, NULL, 0, flags, 0 ) == WAIT_TIMEOUT)
|
||||
flush_window_surfaces( TRUE );
|
||||
}
|
||||
|
||||
+
|
||||
/**********************************************************************
|
||||
* GetAsyncKeyState (USER32.@)
|
||||
*
|
||||
@@ -375,7 +381,7 @@ SHORT WINAPI DECLSPEC_HOTPATCH GetAsyncKeyState( INT key )
|
||||
|
||||
if (key < 0 || key >= 256) return 0;
|
||||
|
||||
- check_for_events( QS_INPUT );
|
||||
+ __wine_check_for_events( QS_INPUT );
|
||||
|
||||
if ((ret = USER_Driver->pGetAsyncKeyState( key )) == -1)
|
||||
{
|
||||
@@ -430,7 +436,7 @@ DWORD WINAPI GetQueueStatus( UINT flags )
|
||||
return 0;
|
||||
}
|
||||
|
||||
- check_for_events( flags );
|
||||
+ __wine_check_for_events( flags );
|
||||
|
||||
SERVER_START_REQ( get_queue_status )
|
||||
{
|
||||
@@ -450,7 +456,7 @@ BOOL WINAPI GetInputState(void)
|
||||
{
|
||||
DWORD ret;
|
||||
|
||||
- check_for_events( QS_INPUT );
|
||||
+ __wine_check_for_events( QS_INPUT );
|
||||
|
||||
SERVER_START_REQ( get_queue_status )
|
||||
{
|
||||
diff --git a/dlls/user32/user32.spec b/dlls/user32/user32.spec
|
||||
index f0e541f..e1f165f 100644
|
||||
--- a/dlls/user32/user32.spec
|
||||
+++ b/dlls/user32/user32.spec
|
||||
@@ -789,5 +789,6 @@
|
||||
# All functions must be prefixed with '__wine_' (for internal functions)
|
||||
# or 'wine_' (for user-visible functions) to avoid namespace conflicts.
|
||||
#
|
||||
+@ cdecl __wine_check_for_events(long)
|
||||
@ cdecl __wine_send_input(long ptr)
|
||||
@ cdecl __wine_set_pixel_format(long long)
|
||||
diff --git a/include/winuser.h b/include/winuser.h
|
||||
index 06ca054..5d32474 100644
|
||||
--- a/include/winuser.h
|
||||
+++ b/include/winuser.h
|
||||
@@ -4061,6 +4061,7 @@ WINUSERAPI INT WINAPI wvsprintfW(LPWSTR,LPCWSTR,__ms_va_list);
|
||||
WORD WINAPI SYSTEM_KillSystemTimer( WORD );
|
||||
|
||||
#ifdef __WINESRC__
|
||||
+WINUSERAPI VOID CDECL __wine_check_for_events( UINT flags );
|
||||
WINUSERAPI BOOL CDECL __wine_send_input( HWND hwnd, const INPUT *input );
|
||||
#endif
|
||||
|
||||
--
|
||||
2.6.0
|
||||
2.6.1
|
||||
|
||||
|
@ -1,60 +0,0 @@
|
||||
From 84f4fe85212ac6bdff8349f41686023ecf1acda3 Mon Sep 17 00:00:00 2001
|
||||
From: Amine Khaldi <amine.khaldi@reactos.org>
|
||||
Date: Mon, 23 Feb 2015 20:14:03 +0100
|
||||
Subject: dinput: Skip Wine specific __wine_check_for_events calls in ReactOS.
|
||||
|
||||
---
|
||||
dlls/dinput/device.c | 5 +++++
|
||||
dlls/dinput/keyboard.c | 2 ++
|
||||
dlls/dinput/mouse.c | 2 ++
|
||||
3 files changed, 9 insertions(+)
|
||||
|
||||
diff --git a/dlls/dinput/device.c b/dlls/dinput/device.c
|
||||
index 60678be..dc901559 100644
|
||||
--- a/dlls/dinput/device.c
|
||||
+++ b/dlls/dinput/device.c
|
||||
@@ -1632,8 +1632,13 @@ HRESULT WINAPI IDirectInputDevice2WImpl_Poll(LPDIRECTINPUTDEVICE8W iface)
|
||||
|
||||
if (!This->acquired) return DIERR_NOTACQUIRED;
|
||||
|
||||
+#ifndef __REACTOS__
|
||||
__wine_check_for_events( QS_ALLINPUT );
|
||||
return DI_OK;
|
||||
+#else
|
||||
+ /* Devices do not need to be polled on ReactOS. */
|
||||
+ return DI_NOEFFECT;
|
||||
+#endif
|
||||
}
|
||||
|
||||
HRESULT WINAPI IDirectInputDevice2AImpl_Poll(LPDIRECTINPUTDEVICE8A iface)
|
||||
diff --git a/dlls/dinput/keyboard.c b/dlls/dinput/keyboard.c
|
||||
index 9e78257..3019552 100644
|
||||
--- a/dlls/dinput/keyboard.c
|
||||
+++ b/dlls/dinput/keyboard.c
|
||||
@@ -335,7 +335,9 @@ static HRESULT WINAPI SysKeyboardWImpl_GetDeviceState(LPDIRECTINPUTDEVICE8W ifac
|
||||
if (len != This->base.data_format.user_df->dwDataSize )
|
||||
return DIERR_INVALIDPARAM;
|
||||
|
||||
+#ifndef __REACTOS__
|
||||
__wine_check_for_events( QS_ALLINPUT );
|
||||
+#endif
|
||||
|
||||
EnterCriticalSection(&This->base.crit);
|
||||
|
||||
diff --git a/dlls/dinput/mouse.c b/dlls/dinput/mouse.c
|
||||
index 44e1d57..8249513 100644
|
||||
--- a/dlls/dinput/mouse.c
|
||||
+++ b/dlls/dinput/mouse.c
|
||||
@@ -552,7 +552,9 @@ static HRESULT WINAPI SysMouseWImpl_GetDeviceState(LPDIRECTINPUTDEVICE8W iface,
|
||||
|
||||
if(This->base.acquired == 0) return DIERR_NOTACQUIRED;
|
||||
|
||||
+#ifndef __REACTOS__
|
||||
__wine_check_for_events( QS_ALLINPUT );
|
||||
+#endif
|
||||
|
||||
TRACE("(this=%p,0x%08x,%p):\n", This, len, ptr);
|
||||
_dump_mouse_state(&This->m_state);
|
||||
--
|
||||
2.3.2
|
||||
|
@ -1774,9 +1774,6 @@ if test "$enable_shell32_Progress_Dialog" -eq 1; then
|
||||
fi
|
||||
|
||||
if test "$enable_server_Shared_Memory" -eq 1; then
|
||||
if test "$enable_dinput_Events" -gt 1; then
|
||||
abort "Patchset dinput-Events disabled, but server-Shared_Memory depends on that."
|
||||
fi
|
||||
if test "$enable_ntdll_Threading" -gt 1; then
|
||||
abort "Patchset ntdll-Threading disabled, but server-Shared_Memory depends on that."
|
||||
fi
|
||||
@ -1789,7 +1786,6 @@ if test "$enable_server_Shared_Memory" -eq 1; then
|
||||
if test "$enable_server_PeekMessage" -gt 1; then
|
||||
abort "Patchset server-PeekMessage disabled, but server-Shared_Memory depends on that."
|
||||
fi
|
||||
enable_dinput_Events=1
|
||||
enable_ntdll_Threading=1
|
||||
enable_server_ClipCursor=1
|
||||
enable_server_Key_State=1
|
||||
@ -2888,15 +2884,12 @@ fi
|
||||
# | * [#34559] Scrolling causes mouse and screen to lock in Call to Power II
|
||||
# |
|
||||
# | Modified files:
|
||||
# | * dlls/dinput/device.c, dlls/dinput/keyboard.c, dlls/dinput/mouse.c, dlls/dinput/tests/mouse.c, dlls/user32/input.c,
|
||||
# | dlls/user32/user32.spec, include/winuser.h
|
||||
# | * dlls/dinput/device.c, dlls/dinput/keyboard.c, dlls/dinput/mouse.c, dlls/dinput/tests/mouse.c
|
||||
# |
|
||||
if test "$enable_dinput_Events" -eq 1; then
|
||||
patch_apply dinput-Events/0001-dinput-Ensure-X11-input-events-are-handled-even-with.patch
|
||||
patch_apply dinput-Events/0002-dinput-Skip-Wine-specific-__wine_check_for_events-ca.patch
|
||||
(
|
||||
echo '+ { "Sebastian Lackner", "dinput: Ensure X11 input events are handled even without explicit message loop.", 3 },';
|
||||
echo '+ { "Amine Khaldi", "dinput: Skip Wine specific __wine_check_for_events calls in ReactOS.", 1 },';
|
||||
echo '+ { "Sebastian Lackner", "dinput: Ensure X11 input events are handled even without explicit message loop.", 4 },';
|
||||
) >> "$patchlist"
|
||||
fi
|
||||
|
||||
@ -4906,7 +4899,7 @@ fi
|
||||
# Patchset server-Shared_Memory
|
||||
# |
|
||||
# | This patchset has the following (direct or indirect) dependencies:
|
||||
# | * dinput-Events, ntdll-Threading, server-ClipCursor, server-Key_State, server-PeekMessage
|
||||
# | * ntdll-Threading, server-ClipCursor, server-Key_State, server-PeekMessage
|
||||
# |
|
||||
# | Modified files:
|
||||
# | * dlls/ntdll/ntdll_misc.h, dlls/ntdll/server.c, dlls/ntdll/thread.c, dlls/ntdll/virtual.c, dlls/user32/focus.c,
|
||||
|
@ -20,7 +20,7 @@ index 130aacc..4cf6b61 100644
|
||||
+ shmlocal_t *shm = wine_get_shmlocal();
|
||||
DWORD ret;
|
||||
|
||||
__wine_check_for_events( QS_INPUT );
|
||||
check_for_events( QS_INPUT );
|
||||
|
||||
+ /* req->clear is not set, so we can safely get the
|
||||
+ * wineserver status without an additional call. */
|
||||
|
@ -1,5 +1,4 @@
|
||||
Depends: ntdll-Threading
|
||||
Depends: dinput-Events
|
||||
Depends: server-Key_State
|
||||
Depends: server-PeekMessage
|
||||
Depends: server-ClipCursor
|
||||
|
Loading…
x
Reference in New Issue
Block a user