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
7c93adbd
Commit
7c93adbd
authored
Feb 15, 2022
by
Rémi Bernon
Committed by
Alexandre Julliard
Feb 15, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winebus.sys: Use a separate hid_device_vtbl function to stop haptics.
Signed-off-by:
Rémi Bernon
<
rbernon@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
a4f7ef29
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
59 additions
and
13 deletions
+59
-13
bus_sdl.c
dlls/winebus.sys/bus_sdl.c
+17
-12
bus_udev.c
dlls/winebus.sys/bus_udev.c
+24
-0
hid.c
dlls/winebus.sys/hid.c
+5
-1
unix_private.h
dlls/winebus.sys/unix_private.h
+1
-0
unixlib.c
dlls/winebus.sys/unixlib.c
+12
-0
No files found.
dlls/winebus.sys/bus_sdl.c
View file @
7c93adbd
...
@@ -417,18 +417,6 @@ NTSTATUS sdl_device_haptics_start(struct unix_device *iface, UINT duration_ms,
...
@@ -417,18 +417,6 @@ NTSTATUS sdl_device_haptics_start(struct unix_device *iface, UINT duration_ms,
effect
.
leftright
.
large_magnitude
=
rumble_intensity
;
effect
.
leftright
.
large_magnitude
=
rumble_intensity
;
effect
.
leftright
.
small_magnitude
=
buzz_intensity
;
effect
.
leftright
.
small_magnitude
=
buzz_intensity
;
if
(
!
effect
.
leftright
.
large_magnitude
&&
!
effect
.
leftright
.
small_magnitude
)
{
if
(
impl
->
effect_support
&
SDL_HAPTIC_LEFTRIGHT
)
pSDL_HapticStopAll
(
impl
->
sdl_haptic
);
else
if
(
impl
->
effect_support
&
WINE_SDL_HAPTIC_RUMBLE
)
pSDL_HapticRumbleStop
(
impl
->
sdl_haptic
);
else
if
(
impl
->
effect_support
&
WINE_SDL_JOYSTICK_RUMBLE
)
pSDL_JoystickRumble
(
impl
->
sdl_joystick
,
0
,
0
,
0
);
return
STATUS_SUCCESS
;
}
if
(
impl
->
effect_support
&
SDL_HAPTIC_LEFTRIGHT
)
if
(
impl
->
effect_support
&
SDL_HAPTIC_LEFTRIGHT
)
{
{
if
(
impl
->
haptic_effect_id
>=
0
)
if
(
impl
->
haptic_effect_id
>=
0
)
...
@@ -451,6 +439,22 @@ NTSTATUS sdl_device_haptics_start(struct unix_device *iface, UINT duration_ms,
...
@@ -451,6 +439,22 @@ NTSTATUS sdl_device_haptics_start(struct unix_device *iface, UINT duration_ms,
return
STATUS_SUCCESS
;
return
STATUS_SUCCESS
;
}
}
NTSTATUS
sdl_device_haptics_stop
(
struct
unix_device
*
iface
)
{
struct
sdl_device
*
impl
=
impl_from_unix_device
(
iface
);
TRACE
(
"iface %p.
\n
"
,
iface
);
if
(
impl
->
effect_support
&
SDL_HAPTIC_LEFTRIGHT
)
pSDL_HapticStopAll
(
impl
->
sdl_haptic
);
else
if
(
impl
->
effect_support
&
WINE_SDL_HAPTIC_RUMBLE
)
pSDL_HapticRumbleStop
(
impl
->
sdl_haptic
);
else
if
(
impl
->
effect_support
&
WINE_SDL_JOYSTICK_RUMBLE
)
pSDL_JoystickRumble
(
impl
->
sdl_joystick
,
0
,
0
,
0
);
return
STATUS_SUCCESS
;
}
static
NTSTATUS
sdl_device_physical_device_control
(
struct
unix_device
*
iface
,
USAGE
control
)
static
NTSTATUS
sdl_device_physical_device_control
(
struct
unix_device
*
iface
,
USAGE
control
)
{
{
struct
sdl_device
*
impl
=
impl_from_unix_device
(
iface
);
struct
sdl_device
*
impl
=
impl_from_unix_device
(
iface
);
...
@@ -695,6 +699,7 @@ static const struct hid_device_vtbl sdl_device_vtbl =
...
@@ -695,6 +699,7 @@ static const struct hid_device_vtbl sdl_device_vtbl =
sdl_device_start
,
sdl_device_start
,
sdl_device_stop
,
sdl_device_stop
,
sdl_device_haptics_start
,
sdl_device_haptics_start
,
sdl_device_haptics_stop
,
sdl_device_physical_device_control
,
sdl_device_physical_device_control
,
sdl_device_physical_device_set_gain
,
sdl_device_physical_device_set_gain
,
sdl_device_physical_effect_control
,
sdl_device_physical_effect_control
,
...
...
dlls/winebus.sys/bus_udev.c
View file @
7c93adbd
...
@@ -906,6 +906,29 @@ static NTSTATUS lnxev_device_haptics_start(struct unix_device *iface, UINT durat
...
@@ -906,6 +906,29 @@ static NTSTATUS lnxev_device_haptics_start(struct unix_device *iface, UINT durat
return
STATUS_SUCCESS
;
return
STATUS_SUCCESS
;
}
}
static
NTSTATUS
lnxev_device_haptics_stop
(
struct
unix_device
*
iface
)
{
struct
lnxev_device
*
impl
=
lnxev_impl_from_unix_device
(
iface
);
struct
ff_effect
effect
=
{
.
id
=
impl
->
haptic_effect_id
,
.
type
=
FF_RUMBLE
,
};
struct
input_event
event
;
TRACE
(
"iface %p.
\n
"
,
iface
);
if
(
effect
.
id
==
-
1
)
return
STATUS_SUCCESS
;
event
.
type
=
EV_FF
;
event
.
code
=
effect
.
id
;
event
.
value
=
0
;
if
(
write
(
impl
->
base
.
device_fd
,
&
event
,
sizeof
(
event
))
==
-
1
)
WARN
(
"couldn't stop haptics rumble effect: %d %s
\n
"
,
errno
,
strerror
(
errno
));
return
STATUS_SUCCESS
;
}
static
NTSTATUS
lnxev_device_physical_effect_run
(
struct
lnxev_device
*
impl
,
BYTE
index
,
static
NTSTATUS
lnxev_device_physical_effect_run
(
struct
lnxev_device
*
impl
,
BYTE
index
,
int
iterations
)
int
iterations
)
{
{
...
@@ -1185,6 +1208,7 @@ static const struct hid_device_vtbl lnxev_device_vtbl =
...
@@ -1185,6 +1208,7 @@ static const struct hid_device_vtbl lnxev_device_vtbl =
lnxev_device_start
,
lnxev_device_start
,
lnxev_device_stop
,
lnxev_device_stop
,
lnxev_device_haptics_start
,
lnxev_device_haptics_start
,
lnxev_device_haptics_stop
,
lnxev_device_physical_device_control
,
lnxev_device_physical_device_control
,
lnxev_device_physical_device_set_gain
,
lnxev_device_physical_device_set_gain
,
lnxev_device_physical_effect_control
,
lnxev_device_physical_effect_control
,
...
...
dlls/winebus.sys/hid.c
View file @
7c93adbd
...
@@ -1050,14 +1050,18 @@ static void hid_device_set_output_report(struct unix_device *iface, HID_XFER_PAC
...
@@ -1050,14 +1050,18 @@ static void hid_device_set_output_report(struct unix_device *iface, HID_XFER_PAC
else
else
{
{
if
(
waveform
->
manual_trigger
==
HAPTICS_WAVEFORM_STOP_ORDINAL
)
if
(
waveform
->
manual_trigger
==
HAPTICS_WAVEFORM_STOP_ORDINAL
)
{
memset
(
haptics
->
waveforms
,
0
,
sizeof
(
haptics
->
waveforms
));
memset
(
haptics
->
waveforms
,
0
,
sizeof
(
haptics
->
waveforms
));
io
->
Status
=
iface
->
hid_vtbl
->
haptics_stop
(
iface
);
}
else
else
{
haptics
->
waveforms
[
waveform
->
manual_trigger
]
=
*
waveform
;
haptics
->
waveforms
[
waveform
->
manual_trigger
]
=
*
waveform
;
duration_ms
=
haptics
->
features
.
waveform_cutoff_time_ms
;
duration_ms
=
haptics
->
features
.
waveform_cutoff_time_ms
;
io
->
Status
=
iface
->
hid_vtbl
->
haptics_start
(
iface
,
duration_ms
,
rumble
->
intensity
,
buzz
->
intensity
);
io
->
Status
=
iface
->
hid_vtbl
->
haptics_start
(
iface
,
duration_ms
,
rumble
->
intensity
,
buzz
->
intensity
);
}
}
}
}
}
else
if
(
packet
->
reportId
==
physical
->
device_control_report
)
else
if
(
packet
->
reportId
==
physical
->
device_control_report
)
{
{
struct
pid_device_control
*
report
=
(
struct
pid_device_control
*
)(
packet
->
reportBuffer
+
1
);
struct
pid_device_control
*
report
=
(
struct
pid_device_control
*
)(
packet
->
reportBuffer
+
1
);
...
...
dlls/winebus.sys/unix_private.h
View file @
7c93adbd
...
@@ -107,6 +107,7 @@ struct hid_device_vtbl
...
@@ -107,6 +107,7 @@ struct hid_device_vtbl
void
(
*
stop
)(
struct
unix_device
*
iface
);
void
(
*
stop
)(
struct
unix_device
*
iface
);
NTSTATUS
(
*
haptics_start
)(
struct
unix_device
*
iface
,
UINT
duration_ms
,
NTSTATUS
(
*
haptics_start
)(
struct
unix_device
*
iface
,
UINT
duration_ms
,
USHORT
rumble_intensity
,
USHORT
buzz_intensity
);
USHORT
rumble_intensity
,
USHORT
buzz_intensity
);
NTSTATUS
(
*
haptics_stop
)(
struct
unix_device
*
iface
);
NTSTATUS
(
*
physical_device_control
)(
struct
unix_device
*
iface
,
USAGE
control
);
NTSTATUS
(
*
physical_device_control
)(
struct
unix_device
*
iface
,
USAGE
control
);
NTSTATUS
(
*
physical_device_set_gain
)(
struct
unix_device
*
iface
,
BYTE
percent
);
NTSTATUS
(
*
physical_device_set_gain
)(
struct
unix_device
*
iface
,
BYTE
percent
);
NTSTATUS
(
*
physical_effect_control
)(
struct
unix_device
*
iface
,
BYTE
index
,
USAGE
control
,
BYTE
iterations
);
NTSTATUS
(
*
physical_effect_control
)(
struct
unix_device
*
iface
,
BYTE
index
,
USAGE
control
,
BYTE
iterations
);
...
...
dlls/winebus.sys/unixlib.c
View file @
7c93adbd
...
@@ -107,6 +107,11 @@ static NTSTATUS mouse_haptics_start(struct unix_device *iface, UINT duration,
...
@@ -107,6 +107,11 @@ static NTSTATUS mouse_haptics_start(struct unix_device *iface, UINT duration,
return
STATUS_NOT_SUPPORTED
;
return
STATUS_NOT_SUPPORTED
;
}
}
static
NTSTATUS
mouse_haptics_stop
(
struct
unix_device
*
iface
)
{
return
STATUS_NOT_SUPPORTED
;
}
static
NTSTATUS
mouse_physical_device_control
(
struct
unix_device
*
iface
,
USAGE
control
)
static
NTSTATUS
mouse_physical_device_control
(
struct
unix_device
*
iface
,
USAGE
control
)
{
{
return
STATUS_NOT_SUPPORTED
;
return
STATUS_NOT_SUPPORTED
;
...
@@ -135,6 +140,7 @@ static const struct hid_device_vtbl mouse_vtbl =
...
@@ -135,6 +140,7 @@ static const struct hid_device_vtbl mouse_vtbl =
mouse_start
,
mouse_start
,
mouse_stop
,
mouse_stop
,
mouse_haptics_start
,
mouse_haptics_start
,
mouse_haptics_stop
,
mouse_physical_device_control
,
mouse_physical_device_control
,
mouse_physical_device_set_gain
,
mouse_physical_device_set_gain
,
mouse_physical_effect_control
,
mouse_physical_effect_control
,
...
@@ -190,6 +196,11 @@ static NTSTATUS keyboard_haptics_start(struct unix_device *iface, UINT duration,
...
@@ -190,6 +196,11 @@ static NTSTATUS keyboard_haptics_start(struct unix_device *iface, UINT duration,
return
STATUS_NOT_SUPPORTED
;
return
STATUS_NOT_SUPPORTED
;
}
}
static
NTSTATUS
keyboard_haptics_stop
(
struct
unix_device
*
iface
)
{
return
STATUS_NOT_SUPPORTED
;
}
static
NTSTATUS
keyboard_physical_device_control
(
struct
unix_device
*
iface
,
USAGE
control
)
static
NTSTATUS
keyboard_physical_device_control
(
struct
unix_device
*
iface
,
USAGE
control
)
{
{
return
STATUS_NOT_SUPPORTED
;
return
STATUS_NOT_SUPPORTED
;
...
@@ -218,6 +229,7 @@ static const struct hid_device_vtbl keyboard_vtbl =
...
@@ -218,6 +229,7 @@ static const struct hid_device_vtbl keyboard_vtbl =
keyboard_start
,
keyboard_start
,
keyboard_stop
,
keyboard_stop
,
keyboard_haptics_start
,
keyboard_haptics_start
,
keyboard_haptics_stop
,
keyboard_physical_device_control
,
keyboard_physical_device_control
,
keyboard_physical_device_set_gain
,
keyboard_physical_device_set_gain
,
keyboard_physical_effect_control
,
keyboard_physical_effect_control
,
...
...
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