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
059d5ece
Commit
059d5ece
authored
Dec 18, 2017
by
Sebastian Lackner
Committed by
Alexandre Julliard
Dec 18, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
user32: Globally invalidate key state on changes in other threads.
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
54c414d9
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
2 deletions
+12
-2
input.c
dlls/user32/input.c
+12
-2
No files found.
dlls/user32/input.c
View file @
059d5ece
...
...
@@ -390,6 +390,7 @@ SHORT WINAPI DECLSPEC_HOTPATCH GetAsyncKeyState( INT key )
{
struct
user_key_state_info
*
key_state_info
=
get_user_thread_info
()
->
key_state
;
INT
counter
=
global_key_state_counter
;
BYTE
prev_key_state
;
SHORT
ret
;
if
(
key
<
0
||
key
>=
256
)
return
0
;
...
...
@@ -417,14 +418,23 @@ SHORT WINAPI DECLSPEC_HOTPATCH GetAsyncKeyState( INT key )
{
req
->
tid
=
0
;
req
->
key
=
key
;
if
(
key_state_info
)
wine_server_set_reply
(
req
,
key_state_info
->
state
,
sizeof
(
key_state_info
->
state
)
);
if
(
key_state_info
)
{
prev_key_state
=
key_state_info
->
state
[
key
];
wine_server_set_reply
(
req
,
key_state_info
->
state
,
sizeof
(
key_state_info
->
state
)
);
}
if
(
!
wine_server_call
(
req
))
{
if
(
reply
->
state
&
0x40
)
ret
|=
0x0001
;
if
(
reply
->
state
&
0x80
)
ret
|=
0x8000
;
if
(
key_state_info
)
{
/* force refreshing the key state cache - some multithreaded programs
* (like Adobe Photoshop CS5) expect that changes to the async key state
* are also immediately available in other threads. */
if
(
prev_key_state
!=
key_state_info
->
state
[
key
])
counter
=
interlocked_xchg_add
(
&
global_key_state_counter
,
1
)
+
1
;
key_state_info
->
time
=
GetTickCount
();
key_state_info
->
counter
=
counter
;
}
...
...
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