Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
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-winehq
Commits
464ce9a0
Commit
464ce9a0
authored
May 02, 2024
by
Rémi Bernon
Committed by
Alexandre Julliard
May 02, 2024
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
win32u: Move rawinput device cache ticks check to rawinput_update_device_list.
parent
f333f4cd
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
9 deletions
+9
-9
rawinput.c
dlls/win32u/rawinput.c
+9
-9
No files found.
dlls/win32u/rawinput.c
View file @
464ce9a0
...
...
@@ -282,12 +282,17 @@ static void enumerate_devices( DWORD type, const WCHAR *class )
NtClose
(
class_key
);
}
static
void
rawinput_update_device_list
(
void
)
static
void
rawinput_update_device_list
(
BOOL
force
)
{
unsigned
int
ticks
=
NtGetTickCount
();
static
unsigned
int
last_check
;
struct
device
*
device
,
*
next
;
TRACE
(
"
\n
"
);
if
(
ticks
-
last_check
<=
2000
&&
!
force
)
return
;
last_check
=
ticks
;
LIST_FOR_EACH_ENTRY_SAFE
(
device
,
next
,
&
devices
,
struct
device
,
entry
)
{
list_remove
(
&
device
->
entry
);
...
...
@@ -309,7 +314,7 @@ static struct device *find_device_from_handle( HANDLE handle, BOOL refresh )
if
(
device
->
handle
==
handle
)
return
device
;
if
(
!
refresh
)
return
NULL
;
rawinput_update_device_list
();
rawinput_update_device_list
(
TRUE
);
LIST_FOR_EACH_ENTRY
(
device
,
&
devices
,
struct
device
,
entry
)
if
(
device
->
handle
==
handle
)
return
device
;
...
...
@@ -322,8 +327,7 @@ static struct device *find_device_from_handle( HANDLE handle, BOOL refresh )
*/
UINT
WINAPI
NtUserGetRawInputDeviceList
(
RAWINPUTDEVICELIST
*
device_list
,
UINT
*
device_count
,
UINT
size
)
{
unsigned
int
count
=
0
,
ticks
=
NtGetTickCount
();
static
unsigned
int
last_check
;
unsigned
int
count
=
0
;
struct
device
*
device
;
TRACE
(
"device_list %p, device_count %p, size %u.
\n
"
,
device_list
,
device_count
,
size
);
...
...
@@ -342,11 +346,7 @@ UINT WINAPI NtUserGetRawInputDeviceList( RAWINPUTDEVICELIST *device_list, UINT *
pthread_mutex_lock
(
&
rawinput_mutex
);
if
(
ticks
-
last_check
>
2000
)
{
last_check
=
ticks
;
rawinput_update_device_list
();
}
rawinput_update_device_list
(
FALSE
);
LIST_FOR_EACH_ENTRY
(
device
,
&
devices
,
struct
device
,
entry
)
{
...
...
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