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
a6f7f2dc
Commit
a6f7f2dc
authored
Sep 23, 2021
by
Rémi Bernon
Committed by
Alexandre Julliard
Sep 23, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
joy.cpl: Refresh joystick FF device list when activated.
Signed-off-by:
Rémi Bernon
<
rbernon@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
95cc64aa
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
20 deletions
+12
-20
main.c
dlls/joy.cpl/main.c
+12
-20
No files found.
dlls/joy.cpl/main.c
View file @
a6f7f2dc
...
@@ -642,12 +642,9 @@ static void initialize_effects_list(HWND hwnd, struct Joystick* joy)
...
@@ -642,12 +642,9 @@ static void initialize_effects_list(HWND hwnd, struct Joystick* joy)
static
void
ff_handle_joychange
(
HWND
hwnd
,
struct
JoystickData
*
data
)
static
void
ff_handle_joychange
(
HWND
hwnd
,
struct
JoystickData
*
data
)
{
{
int
sel
;
if
(
data
->
num_ff
==
0
)
return
;
if
(
data
->
num_ff
==
0
)
return
;
sel
=
SendDlgItemMessageW
(
hwnd
,
IDC_FFSELECTCOMBO
,
CB_GETCURSEL
,
0
,
0
);
data
->
chosen_joystick
=
SendDlgItemMessageW
(
hwnd
,
IDC_FFSELECTCOMBO
,
CB_GETCURSEL
,
0
,
0
);
data
->
chosen_joystick
=
SendDlgItemMessageW
(
hwnd
,
IDC_FFSELECTCOMBO
,
CB_GETITEMDATA
,
sel
,
0
);
initialize_effects_list
(
hwnd
,
&
data
->
joysticks
[
data
->
chosen_joystick
]);
initialize_effects_list
(
hwnd
,
&
data
->
joysticks
[
data
->
chosen_joystick
]);
}
}
...
@@ -808,6 +805,14 @@ static BOOL CALLBACK ff_effects_callback(const DIEFFECTINFOW *pdei, void *pvRef)
...
@@ -808,6 +805,14 @@ static BOOL CALLBACK ff_effects_callback(const DIEFFECTINFOW *pdei, void *pvRef)
* ff_dlgproc [internal]
* ff_dlgproc [internal]
*
*
*/
*/
static
void
refresh_ff_joystick_list
(
HWND
hwnd
,
struct
JoystickData
*
data
)
{
struct
Joystick
*
joy
,
*
joy_end
;
SendDlgItemMessageW
(
hwnd
,
IDC_FFSELECTCOMBO
,
CB_RESETCONTENT
,
0
,
0
);
for
(
joy
=
data
->
joysticks
,
joy_end
=
joy
+
data
->
num_joysticks
;
joy
!=
joy_end
;
++
joy
)
SendDlgItemMessageW
(
hwnd
,
IDC_FFSELECTCOMBO
,
CB_ADDSTRING
,
0
,
(
LPARAM
)
joy
->
instance
.
tszInstanceName
);
}
static
INT_PTR
CALLBACK
ff_dlgproc
(
HWND
hwnd
,
UINT
msg
,
WPARAM
wparam
,
LPARAM
lparam
)
static
INT_PTR
CALLBACK
ff_dlgproc
(
HWND
hwnd
,
UINT
msg
,
WPARAM
wparam
,
LPARAM
lparam
)
{
{
static
HANDLE
thread
;
static
HANDLE
thread
;
...
@@ -818,24 +823,9 @@ static INT_PTR CALLBACK ff_dlgproc(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lp
...
@@ -818,24 +823,9 @@ static INT_PTR CALLBACK ff_dlgproc(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lp
{
{
case
WM_INITDIALOG
:
case
WM_INITDIALOG
:
{
{
int
i
,
cur
=
0
;
data
=
(
struct
JoystickData
*
)
((
PROPSHEETPAGEW
*
)
lparam
)
->
lParam
;
data
=
(
struct
JoystickData
*
)
((
PROPSHEETPAGEW
*
)
lparam
)
->
lParam
;
/* Add joysticks with FF support to the combobox and get the effects */
refresh_ff_joystick_list
(
hwnd
,
data
);
for
(
i
=
0
;
i
<
data
->
num_joysticks
;
i
++
)
{
struct
Joystick
*
joy
=
&
data
->
joysticks
[
i
];
if
(
joy
->
forcefeedback
)
{
SendDlgItemMessageW
(
hwnd
,
IDC_FFSELECTCOMBO
,
CB_ADDSTRING
,
0
,
(
LPARAM
)
joy
->
instance
.
tszInstanceName
);
SendDlgItemMessageW
(
hwnd
,
IDC_FFSELECTCOMBO
,
CB_SETITEMDATA
,
cur
,
i
);
cur
++
;
}
}
draw_ff_axis
(
hwnd
,
data
);
draw_ff_axis
(
hwnd
,
data
);
return
TRUE
;
return
TRUE
;
...
@@ -861,6 +851,8 @@ static INT_PTR CALLBACK ff_dlgproc(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lp
...
@@ -861,6 +851,8 @@ static INT_PTR CALLBACK ff_dlgproc(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lp
switch
(((
LPNMHDR
)
lparam
)
->
code
)
switch
(((
LPNMHDR
)
lparam
)
->
code
)
{
{
case
PSN_SETACTIVE
:
case
PSN_SETACTIVE
:
refresh_ff_joystick_list
(
hwnd
,
data
);
if
(
data
->
num_ff
>
0
)
if
(
data
->
num_ff
>
0
)
{
{
DWORD
tid
;
DWORD
tid
;
...
...
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