Rémi Bernon : joy.cpl: Refresh joystick test device list when activated.
Alexandre Julliard
julliard at winehq.org
Thu Sep 23 15:35:05 CDT 2021
Module: wine
Branch: master
Commit: 95cc64aa731d9babfba677d6dca97d13efebd476
URL: https://source.winehq.org/git/wine.git/?a=commit;h=95cc64aa731d9babfba677d6dca97d13efebd476
Author: Rémi Bernon <rbernon at codeweavers.com>
Date: Thu Sep 23 14:01:53 2021 +0200
joy.cpl: Refresh joystick test device list when activated.
Signed-off-by: Rémi Bernon <rbernon at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
---
dlls/joy.cpl/main.c | 20 +++++++++++---------
1 file changed, 11 insertions(+), 9 deletions(-)
diff --git a/dlls/joy.cpl/main.c b/dlls/joy.cpl/main.c
index ef905c65a93..3dee30a4b5b 100644
--- a/dlls/joy.cpl/main.c
+++ b/dlls/joy.cpl/main.c
@@ -533,6 +533,14 @@ static void draw_joystick_axes(HWND hwnd, struct JoystickData* data)
* test_dlgproc [internal]
*
*/
+static void refresh_test_joystick_list(HWND hwnd, struct JoystickData *data)
+{
+ struct Joystick *joy, *joy_end;
+ SendDlgItemMessageW(hwnd, IDC_TESTSELECTCOMBO, CB_RESETCONTENT, 0, 0);
+ for (joy = data->joysticks, joy_end = joy + data->num_joysticks; joy != joy_end; ++joy)
+ SendDlgItemMessageW(hwnd, IDC_TESTSELECTCOMBO, CB_ADDSTRING, 0, (LPARAM)joy->instance.tszInstanceName);
+}
+
static INT_PTR CALLBACK test_dlgproc(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam)
{
static HANDLE thread;
@@ -543,17 +551,9 @@ static INT_PTR CALLBACK test_dlgproc(HWND hwnd, UINT msg, WPARAM wparam, LPARAM
{
case WM_INITDIALOG:
{
- int i;
-
data = (struct JoystickData*) ((PROPSHEETPAGEW*)lparam)->lParam;
- /* Add enumerated joysticks to the combobox */
- for (i = 0; i < data->num_joysticks; i++)
- {
- struct Joystick *joy = &data->joysticks[i];
- SendDlgItemMessageW(hwnd, IDC_TESTSELECTCOMBO, CB_ADDSTRING, 0, (LPARAM) joy->instance.tszInstanceName);
- }
-
+ refresh_test_joystick_list(hwnd, data);
draw_joystick_buttons(hwnd, data);
draw_joystick_axes(hwnd, data);
@@ -576,6 +576,8 @@ static INT_PTR CALLBACK test_dlgproc(HWND hwnd, UINT msg, WPARAM wparam, LPARAM
{
DWORD tid;
+ refresh_test_joystick_list(hwnd, data);
+
/* Initialize input thread */
if (data->num_joysticks > 0)
{
More information about the wine-cvs
mailing list