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
d3bca134
Commit
d3bca134
authored
Sep 12, 2022
by
Rémi Bernon
Committed by
Alexandre Julliard
Nov 02, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winebus.sys: Ignore SDL events for devices which aren't started.
Wine-Bug:
https://bugs.winehq.org/show_bug.cgi?id=53666
parent
764f91e5
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
8 deletions
+22
-8
bus_sdl.c
dlls/winebus.sys/bus_sdl.c
+22
-8
No files found.
dlls/winebus.sys/bus_sdl.c
View file @
d3bca134
...
...
@@ -137,6 +137,7 @@ struct sdl_device
SDL_Joystick
*
sdl_joystick
;
SDL_GameController
*
sdl_controller
;
SDL_JoystickID
id
;
BOOL
started
;
DWORD
effect_support
;
SDL_Haptic
*
sdl_haptic
;
...
...
@@ -439,8 +440,17 @@ static void sdl_device_destroy(struct unix_device *iface)
static
NTSTATUS
sdl_device_start
(
struct
unix_device
*
iface
)
{
struct
sdl_device
*
impl
=
impl_from_unix_device
(
iface
);
if
(
impl
->
sdl_controller
)
return
build_controller_report_descriptor
(
iface
);
return
build_joystick_report_descriptor
(
iface
);
NTSTATUS
status
;
pthread_mutex_lock
(
&
sdl_cs
);
if
(
impl
->
sdl_controller
)
status
=
build_controller_report_descriptor
(
iface
);
else
status
=
build_joystick_report_descriptor
(
iface
);
impl
->
started
=
!
status
;
pthread_mutex_unlock
(
&
sdl_cs
);
return
status
;
}
static
void
sdl_device_stop
(
struct
unix_device
*
iface
)
...
...
@@ -452,6 +462,7 @@ static void sdl_device_stop(struct unix_device *iface)
if
(
impl
->
sdl_haptic
)
pSDL_HapticClose
(
impl
->
sdl_haptic
);
pthread_mutex_lock
(
&
sdl_cs
);
impl
->
started
=
FALSE
;
list_remove
(
&
impl
->
unix_device
.
entry
);
pthread_mutex_unlock
(
&
sdl_cs
);
}
...
...
@@ -1009,13 +1020,14 @@ static void process_device_event(SDL_Event *event)
id
=
((
SDL_JoyDeviceEvent
*
)
event
)
->
which
;
impl
=
find_device_from_id
(
id
);
if
(
impl
)
bus_event_queue_device_removed
(
&
event_queue
,
&
impl
->
unix_device
);
else
WARN
(
"
f
ailed to find device with id %d
\n
"
,
id
);
else
WARN
(
"
F
ailed to find device with id %d
\n
"
,
id
);
}
else
if
(
event
->
type
==
SDL_JOYAXISMOTION
&&
options
.
split_controllers
)
{
id
=
event
->
jaxis
.
which
;
impl
=
find_device_from_id_and_axis
(
id
,
event
->
jaxis
.
axis
);
if
(
!
impl
)
WARN
(
"failed to find device with id %d for axis %d
\n
"
,
id
,
event
->
jaxis
.
axis
);
if
(
!
impl
)
WARN
(
"Failed to find device with id %d for axis %d
\n
"
,
id
,
event
->
jaxis
.
axis
);
else
if
(
!
impl
->
started
)
WARN
(
"Device %p with id %d is stopped, ignoring event %#x
\n
"
,
impl
,
id
,
event
->
type
);
else
{
event
->
jaxis
.
axis
-=
impl
->
axis_offset
;
...
...
@@ -1026,15 +1038,17 @@ static void process_device_event(SDL_Event *event)
{
id
=
((
SDL_JoyButtonEvent
*
)
event
)
->
which
;
impl
=
find_device_from_id
(
id
);
if
(
impl
)
set_report_from_joystick_event
(
impl
,
event
);
else
WARN
(
"failed to find device with id %d
\n
"
,
id
);
if
(
!
impl
)
WARN
(
"Failed to find device with id %d
\n
"
,
id
);
else
if
(
!
impl
->
started
)
WARN
(
"Device %p with id %d is stopped, ignoring event %#x
\n
"
,
impl
,
id
,
event
->
type
);
else
set_report_from_joystick_event
(
impl
,
event
);
}
else
if
(
event
->
type
>=
SDL_CONTROLLERAXISMOTION
&&
event
->
type
<=
SDL_CONTROLLERBUTTONUP
)
{
id
=
((
SDL_ControllerButtonEvent
*
)
event
)
->
which
;
impl
=
find_device_from_id
(
id
);
if
(
impl
)
set_report_from_controller_event
(
impl
,
event
);
else
WARN
(
"failed to find device with id %d
\n
"
,
id
);
if
(
!
impl
)
WARN
(
"Failed to find device with id %d
\n
"
,
id
);
else
if
(
!
impl
->
started
)
WARN
(
"Device %p with id %d is stopped, ignoring event %#x
\n
"
,
impl
,
id
,
event
->
type
);
else
set_report_from_controller_event
(
impl
,
event
);
}
pthread_mutex_unlock
(
&
sdl_cs
);
...
...
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