Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-cw
Commits
7c88cf0f
Commit
7c88cf0f
authored
Jan 05, 2022
by
Rémi Bernon
Committed by
Alexandre Julliard
Jan 27, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dinput: Introduce new dinput_unacquire_window_devices helper.
parent
0a355d8a
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
13 deletions
+18
-13
dinput_main.c
dlls/dinput/dinput_main.c
+18
-13
No files found.
dlls/dinput/dinput_main.c
View file @
7c88cf0f
...
...
@@ -193,22 +193,15 @@ static LRESULT CALLBACK input_thread_ll_hook_proc( int code, WPARAM wparam, LPAR
return
skip
?
1
:
CallNextHookEx
(
0
,
code
,
wparam
,
lparam
);
}
static
LRESULT
CALLBACK
callwndproc_proc
(
int
code
,
WPARAM
wparam
,
LPARAM
lparam
)
static
void
dinput_unacquire_window_devices
(
HWND
window
)
{
struct
dinput_device
*
impl
,
*
next
;
CWPSTRUCT
*
msg
=
(
CWPSTRUCT
*
)
lparam
;
HWND
foreground
;
if
(
code
!=
HC_ACTION
||
(
msg
->
message
!=
WM_KILLFOCUS
&&
msg
->
message
!=
WM_ACTIVATEAPP
&&
msg
->
message
!=
WM_ACTIVATE
))
return
CallNextHookEx
(
0
,
code
,
wparam
,
lparam
);
foreground
=
GetForegroundWindow
();
EnterCriticalSection
(
&
dinput_hook_crit
);
LIST_FOR_EACH_ENTRY_SAFE
(
impl
,
next
,
&
acquired_device_list
,
struct
dinput_device
,
entry
)
{
if
(
msg
->
hwnd
==
impl
->
win
&&
msg
->
hwnd
!=
foreground
)
if
(
window
==
impl
->
win
)
{
TRACE
(
"%p window is not foreground - unacquiring %p
\n
"
,
impl
->
win
,
impl
);
dinput_device_internal_unacquire
(
&
impl
->
IDirectInputDevice8W_iface
,
STATUS_UNACQUIRED
);
...
...
@@ -216,7 +209,7 @@ static LRESULT CALLBACK callwndproc_proc( int code, WPARAM wparam, LPARAM lparam
}
LIST_FOR_EACH_ENTRY_SAFE
(
impl
,
next
,
&
acquired_mouse_list
,
struct
dinput_device
,
entry
)
{
if
(
msg
->
hwnd
==
impl
->
win
&&
msg
->
hwnd
!=
foreground
)
if
(
window
==
impl
->
win
)
{
TRACE
(
"%p window is not foreground - unacquiring %p
\n
"
,
impl
->
win
,
impl
);
dinput_device_internal_unacquire
(
&
impl
->
IDirectInputDevice8W_iface
,
STATUS_UNACQUIRED
);
...
...
@@ -224,7 +217,7 @@ static LRESULT CALLBACK callwndproc_proc( int code, WPARAM wparam, LPARAM lparam
}
LIST_FOR_EACH_ENTRY_SAFE
(
impl
,
next
,
&
acquired_rawmouse_list
,
struct
dinput_device
,
entry
)
{
if
(
msg
->
hwnd
==
impl
->
win
&&
msg
->
hwnd
!=
foreground
)
if
(
window
==
impl
->
win
)
{
TRACE
(
"%p window is not foreground - unacquiring %p
\n
"
,
impl
->
win
,
impl
);
dinput_device_internal_unacquire
(
&
impl
->
IDirectInputDevice8W_iface
,
STATUS_UNACQUIRED
);
...
...
@@ -232,13 +225,25 @@ static LRESULT CALLBACK callwndproc_proc( int code, WPARAM wparam, LPARAM lparam
}
LIST_FOR_EACH_ENTRY_SAFE
(
impl
,
next
,
&
acquired_keyboard_list
,
struct
dinput_device
,
entry
)
{
if
(
msg
->
hwnd
==
impl
->
win
&&
msg
->
hwnd
!=
foreground
)
if
(
window
==
impl
->
win
)
{
TRACE
(
"%p window is not foreground - unacquiring %p
\n
"
,
impl
->
win
,
impl
);
dinput_device_internal_unacquire
(
&
impl
->
IDirectInputDevice8W_iface
,
STATUS_UNACQUIRED
);
}
}
LeaveCriticalSection
(
&
dinput_hook_crit
);
}
static
LRESULT
CALLBACK
callwndproc_proc
(
int
code
,
WPARAM
wparam
,
LPARAM
lparam
)
{
CWPSTRUCT
*
msg
=
(
CWPSTRUCT
*
)
lparam
;
if
(
code
!=
HC_ACTION
||
(
msg
->
message
!=
WM_KILLFOCUS
&&
msg
->
message
!=
WM_ACTIVATEAPP
&&
msg
->
message
!=
WM_ACTIVATE
))
return
CallNextHookEx
(
0
,
code
,
wparam
,
lparam
);
if
(
msg
->
hwnd
!=
GetForegroundWindow
())
dinput_unacquire_window_devices
(
msg
->
hwnd
);
return
CallNextHookEx
(
0
,
code
,
wparam
,
lparam
);
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment