winecfg: Set buddy window for the size up-down control only once.

Fix the size up-down control becoming smaller every time the apply button is pressed in the Desktop
Integration tab.

UDM_SETBUDDY always shrinks the buddy window for a up-down control according to tests. And a
PSN_SETACTIVE notification is sent every time the apply button is pressed, thus init_dialog() gets
called again and sends an extra UDM_SETBUDDY message.

Signed-off-by: Zhiyi Zhang <zzhang@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Zhiyi Zhang 2021-06-22 16:18:05 +08:00 committed by Alexandre Julliard
parent e9a5cd2e5a
commit bf6ed90cd6
1 changed files with 8 additions and 2 deletions

View File

@ -434,6 +434,12 @@ static void enable_size_and_color_controls (HWND dialog, BOOL enable)
}
static void init_dialog (HWND dialog)
{
SendDlgItemMessageW(dialog, IDC_SYSPARAM_SIZE_UD, UDM_SETBUDDY,
(WPARAM)GetDlgItem(dialog, IDC_SYSPARAM_SIZE), 0);
}
static void update_dialog (HWND dialog)
{
updating_ui = TRUE;
@ -452,7 +458,6 @@ static void init_dialog (HWND dialog)
}
theme_dirty = FALSE;
SendDlgItemMessageW(dialog, IDC_SYSPARAM_SIZE_UD, UDM_SETBUDDY, (WPARAM)GetDlgItem(dialog, IDC_SYSPARAM_SIZE), 0);
SendDlgItemMessageW(dialog, IDC_SYSPARAM_SIZE_UD, UDM_SETRANGE, 0, MAKELONG(100, 8));
updating_ui = FALSE;
@ -1197,6 +1202,7 @@ ThemeDlgProc (HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
update_shell_folder_listview(hDlg);
read_sysparams(hDlg);
init_mime_types(hDlg);
init_dialog(hDlg);
break;
case WM_DESTROY:
@ -1349,7 +1355,7 @@ ThemeDlgProc (HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
break;
}
case PSN_SETACTIVE: {
init_dialog (hDlg);
update_dialog(hDlg);
break;
}
}