diff options
-rw-r--r-- | src/modules/langpack/lpopts.cpp | 28 | ||||
-rw-r--r-- | src/modules/options/options.cpp | 4 |
2 files changed, 22 insertions, 10 deletions
diff --git a/src/modules/langpack/lpopts.cpp b/src/modules/langpack/lpopts.cpp index 33fd36e2a0..80d657c31e 100644 --- a/src/modules/langpack/lpopts.cpp +++ b/src/modules/langpack/lpopts.cpp @@ -97,6 +97,22 @@ static BOOL InsertPackItemEnumProc(LANGPACK_INFO *pack, WPARAM wParam, LPARAM lP return TRUE;
}
+static void CALLBACK OpenOptions(void*)
+{
+ OPENOPTIONSDIALOG ood = { sizeof(ood) };
+ ood.pszGroup = "Customize";
+ ood.pszPage = "Languages";
+ Options_Open(&ood);
+}
+
+static void ReloadOptions(void *hWnd)
+{
+ while (IsWindow((HWND)hWnd))
+ Sleep(50);
+
+ CallFunctionAsync(OpenOptions, 0);
+}
+
INT_PTR CALLBACK DlgLangpackOpt(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam)
{
HWND hwndList = GetDlgItem(hwndDlg, IDC_LANGUAGES);
@@ -174,14 +190,10 @@ INT_PTR CALLBACK DlgLangpackOpt(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP if (tszPath[0]) {
ReloadLangpack(tszPath);
- if (LPNMHDR(lParam)->idFrom == IDC_APPLY) {
- CloseWindow(GetParent(hwndDlg));
- DestroyWindow(GetParent(hwndDlg));
-
- OPENOPTIONSDIALOG ood = { sizeof(ood) };
- ood.pszGroup = "Customize";
- ood.pszPage = "Languages";
- Options_Open(&ood);
+ if (LPPSHNOTIFY(lParam)->lParam == IDC_APPLY) {
+ HWND hwndParent = GetParent(hwndDlg);
+ PostMessage(hwndParent, WM_CLOSE, 1, 0);
+ mir_forkthread(ReloadOptions, hwndParent);
}
}
}
diff --git a/src/modules/options/options.cpp b/src/modules/options/options.cpp index 4812506681..74464fd333 100644 --- a/src/modules/options/options.cpp +++ b/src/modules/options/options.cpp @@ -1115,10 +1115,10 @@ static INT_PTR CALLBACK OptionsDlgProc(HWND hdlg, UINT message, WPARAM wParam, L opd = dat->getCurrent();
if (opd != NULL) {
- pshn.lParam = 0;
+ pshn.hdr.idFrom = 0;
+ pshn.lParam = LOWORD(wParam);
pshn.hdr.code = PSN_KILLACTIVE;
pshn.hdr.hwndFrom = opd->hwnd;
- pshn.hdr.idFrom = LOWORD(wParam);
if (SendMessage(opd->hwnd, WM_NOTIFY, 0, (LPARAM)&pshn))
break;
}
|