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
91d9819c
Commit
91d9819c
authored
Sep 17, 2021
by
Rémi Bernon
Committed by
Alexandre Julliard
Sep 17, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dinput: Fire the notification only after all events have been queued.
Signed-off-by:
Rémi Bernon
<
rbernon@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
334d89a2
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
31 additions
and
3 deletions
+31
-3
device.c
dlls/dinput/device.c
+0
-3
joystick_hid.c
dlls/dinput/joystick_hid.c
+2
-0
joystick_linux.c
dlls/dinput/joystick_linux.c
+3
-0
joystick_linuxinput.c
dlls/dinput/joystick_linuxinput.c
+3
-0
joystick_osx.c
dlls/dinput/joystick_osx.c
+6
-0
keyboard.c
dlls/dinput/keyboard.c
+1
-0
mouse.c
dlls/dinput/mouse.c
+16
-0
No files found.
dlls/dinput/device.c
View file @
91d9819c
...
@@ -986,9 +986,6 @@ void queue_event( IDirectInputDevice8W *iface, int inst_id, DWORD data, DWORD ti
...
@@ -986,9 +986,6 @@ void queue_event( IDirectInputDevice8W *iface, int inst_id, DWORD data, DWORD ti
int
next_pos
,
ofs
=
id_to_offset
(
&
This
->
data_format
,
inst_id
);
int
next_pos
,
ofs
=
id_to_offset
(
&
This
->
data_format
,
inst_id
);
ULONGLONG
time_ms
=
GetTickCount64
();
ULONGLONG
time_ms
=
GetTickCount64
();
/* Event is being set regardless of the queue state */
if
(
This
->
hEvent
)
SetEvent
(
This
->
hEvent
);
if
(
time_ms
-
notify_ms
>
1000
)
if
(
time_ms
-
notify_ms
>
1000
)
{
{
PostMessageW
(
GetDesktopWindow
(),
WM_WINE_NOTIFY_ACTIVITY
,
0
,
0
);
PostMessageW
(
GetDesktopWindow
(),
WM_WINE_NOTIFY_ACTIVITY
,
0
,
0
);
...
...
dlls/dinput/joystick_hid.c
View file @
91d9819c
...
@@ -908,6 +908,8 @@ static HRESULT hid_joystick_read_state( IDirectInputDevice8W *iface )
...
@@ -908,6 +908,8 @@ static HRESULT hid_joystick_read_state( IDirectInputDevice8W *iface )
enum_value_objects
(
impl
,
&
filter
,
DIDFT_ALL
,
read_device_state_value
,
&
params
);
enum_value_objects
(
impl
,
&
filter
,
DIDFT_ALL
,
read_device_state_value
,
&
params
);
enum_button_objects
(
impl
,
&
filter
,
DIDFT_ALL
,
check_device_state_button
,
&
params
);
enum_button_objects
(
impl
,
&
filter
,
DIDFT_ALL
,
check_device_state_button
,
&
params
);
if
(
memcmp
(
&
params
.
old_state
,
&
impl
->
state
,
sizeof
(
impl
->
state
)
)
&&
impl
->
base
.
hEvent
)
SetEvent
(
impl
->
base
.
hEvent
);
}
}
memset
(
&
impl
->
read_ovl
,
0
,
sizeof
(
impl
->
read_ovl
)
);
memset
(
&
impl
->
read_ovl
,
0
,
sizeof
(
impl
->
read_ovl
)
);
...
...
dlls/dinput/joystick_linux.c
View file @
91d9819c
...
@@ -777,7 +777,10 @@ static void joy_polldev( IDirectInputDevice8W *iface )
...
@@ -777,7 +777,10 @@ static void joy_polldev( IDirectInputDevice8W *iface )
}
}
}
}
if
(
inst_id
>=
0
)
if
(
inst_id
>=
0
)
{
queue_event
(
iface
,
inst_id
,
value
,
GetCurrentTime
(),
This
->
generic
.
base
.
dinput
->
evsequence
++
);
queue_event
(
iface
,
inst_id
,
value
,
GetCurrentTime
(),
This
->
generic
.
base
.
dinput
->
evsequence
++
);
if
(
This
->
generic
.
base
.
hEvent
)
SetEvent
(
This
->
generic
.
base
.
hEvent
);
}
}
}
}
}
...
...
dlls/dinput/joystick_linuxinput.c
View file @
91d9819c
...
@@ -806,8 +806,11 @@ static void joy_polldev( IDirectInputDevice8W *iface )
...
@@ -806,8 +806,11 @@ static void joy_polldev( IDirectInputDevice8W *iface )
break
;
break
;
}
}
if
(
inst_id
>=
0
)
if
(
inst_id
>=
0
)
{
queue_event
(
iface
,
inst_id
,
queue_event
(
iface
,
inst_id
,
value
,
GetCurrentTime
(),
This
->
generic
.
base
.
dinput
->
evsequence
++
);
value
,
GetCurrentTime
(),
This
->
generic
.
base
.
dinput
->
evsequence
++
);
if
(
This
->
generic
.
base
.
hEvent
)
SetEvent
(
This
->
generic
.
base
.
hEvent
);
}
}
}
}
}
...
...
dlls/dinput/joystick_osx.c
View file @
91d9819c
...
@@ -840,6 +840,8 @@ static void poll_osx_device_state( IDirectInputDevice8W *iface )
...
@@ -840,6 +840,8 @@ static void poll_osx_device_state( IDirectInputDevice8W *iface )
{
{
inst_id
=
DIDFT_MAKEINSTANCE
(
button_idx
)
|
DIDFT_PSHBUTTON
;
inst_id
=
DIDFT_MAKEINSTANCE
(
button_idx
)
|
DIDFT_PSHBUTTON
;
queue_event
(
iface
,
inst_id
,
newVal
,
GetCurrentTime
(),
device
->
generic
.
base
.
dinput
->
evsequence
++
);
queue_event
(
iface
,
inst_id
,
newVal
,
GetCurrentTime
(),
device
->
generic
.
base
.
dinput
->
evsequence
++
);
if
(
device
->
generic
.
base
.
hEvent
)
SetEvent
(
device
->
generic
.
base
.
hEvent
);
}
}
button_idx
++
;
button_idx
++
;
}
}
...
@@ -870,6 +872,8 @@ static void poll_osx_device_state( IDirectInputDevice8W *iface )
...
@@ -870,6 +872,8 @@ static void poll_osx_device_state( IDirectInputDevice8W *iface )
{
{
inst_id
=
DIDFT_MAKEINSTANCE
(
pov_idx
)
|
DIDFT_POV
;
inst_id
=
DIDFT_MAKEINSTANCE
(
pov_idx
)
|
DIDFT_POV
;
queue_event
(
iface
,
inst_id
,
newVal
,
GetCurrentTime
(),
device
->
generic
.
base
.
dinput
->
evsequence
++
);
queue_event
(
iface
,
inst_id
,
newVal
,
GetCurrentTime
(),
device
->
generic
.
base
.
dinput
->
evsequence
++
);
if
(
device
->
generic
.
base
.
hEvent
)
SetEvent
(
device
->
generic
.
base
.
hEvent
);
}
}
pov_idx
++
;
pov_idx
++
;
break
;
break
;
...
@@ -947,6 +951,8 @@ static void poll_osx_device_state( IDirectInputDevice8W *iface )
...
@@ -947,6 +951,8 @@ static void poll_osx_device_state( IDirectInputDevice8W *iface )
{
{
inst_id
=
DIDFT_MAKEINSTANCE
(
wine_obj
)
|
DIDFT_ABSAXIS
;
inst_id
=
DIDFT_MAKEINSTANCE
(
wine_obj
)
|
DIDFT_ABSAXIS
;
queue_event
(
iface
,
inst_id
,
newVal
,
GetCurrentTime
(),
device
->
generic
.
base
.
dinput
->
evsequence
++
);
queue_event
(
iface
,
inst_id
,
newVal
,
GetCurrentTime
(),
device
->
generic
.
base
.
dinput
->
evsequence
++
);
if
(
device
->
generic
.
base
.
hEvent
)
SetEvent
(
device
->
generic
.
base
.
hEvent
);
}
}
break
;
break
;
...
...
dlls/dinput/keyboard.c
View file @
91d9819c
...
@@ -127,6 +127,7 @@ int dinput_keyboard_hook( IDirectInputDevice8W *iface, WPARAM wparam, LPARAM lpa
...
@@ -127,6 +127,7 @@ int dinput_keyboard_hook( IDirectInputDevice8W *iface, WPARAM wparam, LPARAM lpa
EnterCriticalSection
(
&
This
->
base
.
crit
);
EnterCriticalSection
(
&
This
->
base
.
crit
);
queue_event
(
iface
,
DIDFT_MAKEINSTANCE
(
dik_code
)
|
DIDFT_PSHBUTTON
,
queue_event
(
iface
,
DIDFT_MAKEINSTANCE
(
dik_code
)
|
DIDFT_PSHBUTTON
,
new_diks
,
GetCurrentTime
(),
This
->
base
.
dinput
->
evsequence
++
);
new_diks
,
GetCurrentTime
(),
This
->
base
.
dinput
->
evsequence
++
);
if
(
This
->
base
.
hEvent
)
SetEvent
(
This
->
base
.
hEvent
);
LeaveCriticalSection
(
&
This
->
base
.
crit
);
LeaveCriticalSection
(
&
This
->
base
.
crit
);
return
ret
;
return
ret
;
...
...
dlls/dinput/mouse.c
View file @
91d9819c
...
@@ -234,6 +234,7 @@ void dinput_mouse_rawinput_hook( IDirectInputDevice8W *iface, WPARAM wparam, LPA
...
@@ -234,6 +234,7 @@ void dinput_mouse_rawinput_hook( IDirectInputDevice8W *iface, WPARAM wparam, LPA
POINT
rel
,
pt
;
POINT
rel
,
pt
;
DWORD
seq
;
DWORD
seq
;
int
i
,
wdata
=
0
;
int
i
,
wdata
=
0
;
BOOL
notify
=
FALSE
;
static
const
USHORT
mouse_button_flags
[]
=
static
const
USHORT
mouse_button_flags
[]
=
{
{
...
@@ -277,12 +278,18 @@ void dinput_mouse_rawinput_hook( IDirectInputDevice8W *iface, WPARAM wparam, LPA
...
@@ -277,12 +278,18 @@ void dinput_mouse_rawinput_hook( IDirectInputDevice8W *iface, WPARAM wparam, LPA
}
}
if
(
rel
.
x
)
if
(
rel
.
x
)
{
queue_event
(
iface
,
DIDFT_MAKEINSTANCE
(
WINE_MOUSE_X_AXIS_INSTANCE
)
|
DIDFT_RELAXIS
,
queue_event
(
iface
,
DIDFT_MAKEINSTANCE
(
WINE_MOUSE_X_AXIS_INSTANCE
)
|
DIDFT_RELAXIS
,
pt
.
x
,
GetCurrentTime
(),
seq
);
pt
.
x
,
GetCurrentTime
(),
seq
);
notify
=
TRUE
;
}
if
(
rel
.
y
)
if
(
rel
.
y
)
{
queue_event
(
iface
,
DIDFT_MAKEINSTANCE
(
WINE_MOUSE_Y_AXIS_INSTANCE
)
|
DIDFT_RELAXIS
,
queue_event
(
iface
,
DIDFT_MAKEINSTANCE
(
WINE_MOUSE_Y_AXIS_INSTANCE
)
|
DIDFT_RELAXIS
,
pt
.
y
,
GetCurrentTime
(),
seq
);
pt
.
y
,
GetCurrentTime
(),
seq
);
notify
=
TRUE
;
}
if
(
rel
.
x
||
rel
.
y
)
if
(
rel
.
x
||
rel
.
y
)
{
{
...
@@ -296,6 +303,7 @@ void dinput_mouse_rawinput_hook( IDirectInputDevice8W *iface, WPARAM wparam, LPA
...
@@ -296,6 +303,7 @@ void dinput_mouse_rawinput_hook( IDirectInputDevice8W *iface, WPARAM wparam, LPA
This
->
m_state
.
lZ
+=
(
wdata
=
(
SHORT
)
ri
->
data
.
mouse
.
usButtonData
);
This
->
m_state
.
lZ
+=
(
wdata
=
(
SHORT
)
ri
->
data
.
mouse
.
usButtonData
);
queue_event
(
iface
,
DIDFT_MAKEINSTANCE
(
WINE_MOUSE_Z_AXIS_INSTANCE
)
|
DIDFT_RELAXIS
,
queue_event
(
iface
,
DIDFT_MAKEINSTANCE
(
WINE_MOUSE_Z_AXIS_INSTANCE
)
|
DIDFT_RELAXIS
,
wdata
,
GetCurrentTime
(),
seq
);
wdata
,
GetCurrentTime
(),
seq
);
notify
=
TRUE
;
}
}
for
(
i
=
0
;
i
<
ARRAY_SIZE
(
mouse_button_flags
);
++
i
)
for
(
i
=
0
;
i
<
ARRAY_SIZE
(
mouse_button_flags
);
++
i
)
...
@@ -305,9 +313,11 @@ void dinput_mouse_rawinput_hook( IDirectInputDevice8W *iface, WPARAM wparam, LPA
...
@@ -305,9 +313,11 @@ void dinput_mouse_rawinput_hook( IDirectInputDevice8W *iface, WPARAM wparam, LPA
This
->
m_state
.
rgbButtons
[
i
/
2
]
=
0x80
-
(
i
%
2
)
*
0x80
;
This
->
m_state
.
rgbButtons
[
i
/
2
]
=
0x80
-
(
i
%
2
)
*
0x80
;
queue_event
(
iface
,
DIDFT_MAKEINSTANCE
(
WINE_MOUSE_BUTTONS_INSTANCE
+
(
i
/
2
)
)
|
DIDFT_PSHBUTTON
,
queue_event
(
iface
,
DIDFT_MAKEINSTANCE
(
WINE_MOUSE_BUTTONS_INSTANCE
+
(
i
/
2
)
)
|
DIDFT_PSHBUTTON
,
This
->
m_state
.
rgbButtons
[
i
/
2
],
GetCurrentTime
(),
seq
);
This
->
m_state
.
rgbButtons
[
i
/
2
],
GetCurrentTime
(),
seq
);
notify
=
TRUE
;
}
}
}
}
if
(
notify
&&
This
->
base
.
hEvent
)
SetEvent
(
This
->
base
.
hEvent
);
LeaveCriticalSection
(
&
This
->
base
.
crit
);
LeaveCriticalSection
(
&
This
->
base
.
crit
);
}
}
...
@@ -317,6 +327,7 @@ int dinput_mouse_hook( IDirectInputDevice8W *iface, WPARAM wparam, LPARAM lparam
...
@@ -317,6 +327,7 @@ int dinput_mouse_hook( IDirectInputDevice8W *iface, WPARAM wparam, LPARAM lparam
MSLLHOOKSTRUCT
*
hook
=
(
MSLLHOOKSTRUCT
*
)
lparam
;
MSLLHOOKSTRUCT
*
hook
=
(
MSLLHOOKSTRUCT
*
)
lparam
;
SysMouseImpl
*
This
=
impl_from_IDirectInputDevice8W
(
iface
);
SysMouseImpl
*
This
=
impl_from_IDirectInputDevice8W
(
iface
);
int
wdata
=
0
,
inst_id
=
-
1
,
ret
=
0
;
int
wdata
=
0
,
inst_id
=
-
1
,
ret
=
0
;
BOOL
notify
=
FALSE
;
TRACE
(
"msg %lx @ (%d %d)
\n
"
,
wparam
,
hook
->
pt
.
x
,
hook
->
pt
.
y
);
TRACE
(
"msg %lx @ (%d %d)
\n
"
,
wparam
,
hook
->
pt
.
x
,
hook
->
pt
.
y
);
...
@@ -347,8 +358,11 @@ int dinput_mouse_hook( IDirectInputDevice8W *iface, WPARAM wparam, LPARAM lparam
...
@@ -347,8 +358,11 @@ int dinput_mouse_hook( IDirectInputDevice8W *iface, WPARAM wparam, LPARAM lparam
{
{
/* Already have X, need to queue it */
/* Already have X, need to queue it */
if
(
inst_id
!=
-
1
)
if
(
inst_id
!=
-
1
)
{
queue_event
(
iface
,
inst_id
,
queue_event
(
iface
,
inst_id
,
wdata
,
GetCurrentTime
(),
This
->
base
.
dinput
->
evsequence
);
wdata
,
GetCurrentTime
(),
This
->
base
.
dinput
->
evsequence
);
notify
=
TRUE
;
}
inst_id
=
DIDFT_MAKEINSTANCE
(
WINE_MOUSE_Y_AXIS_INSTANCE
)
|
DIDFT_RELAXIS
;
inst_id
=
DIDFT_MAKEINSTANCE
(
WINE_MOUSE_Y_AXIS_INSTANCE
)
|
DIDFT_RELAXIS
;
wdata
=
pt1
.
y
;
wdata
=
pt1
.
y
;
}
}
...
@@ -408,8 +422,10 @@ int dinput_mouse_hook( IDirectInputDevice8W *iface, WPARAM wparam, LPARAM lparam
...
@@ -408,8 +422,10 @@ int dinput_mouse_hook( IDirectInputDevice8W *iface, WPARAM wparam, LPARAM lparam
_dump_mouse_state
(
&
This
->
m_state
);
_dump_mouse_state
(
&
This
->
m_state
);
queue_event
(
iface
,
inst_id
,
queue_event
(
iface
,
inst_id
,
wdata
,
GetCurrentTime
(),
This
->
base
.
dinput
->
evsequence
++
);
wdata
,
GetCurrentTime
(),
This
->
base
.
dinput
->
evsequence
++
);
notify
=
TRUE
;
}
}
if
(
notify
&&
This
->
base
.
hEvent
)
SetEvent
(
This
->
base
.
hEvent
);
LeaveCriticalSection
(
&
This
->
base
.
crit
);
LeaveCriticalSection
(
&
This
->
base
.
crit
);
return
ret
;
return
ret
;
}
}
...
...
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