diff --git "a/dll/cpl/desk/screensaver.c" "b/dll/cpl/desk/screensaver.c" index a0515eab698..c8329975880 100644 --- "a/dll/cpl/desk/screensaver.c" +++ "b/dll/cpl/desk/screensaver.c" @@ -245,12 +245,16 @@ WaitForSettingsDialog(HWND hwndDlg, { return FALSE; } - if (IsDialogMessage(hwndDlg, &msg)) + if (!IsDialogMessage(hwndDlg, &msg)) { TranslateMessage(&msg); DispatchMessage(&msg); } } + else + { + return FALSE; + } } else if (dwResult == WAIT_OBJECT_0) { @@ -308,8 +312,8 @@ ScreenSaverConfig(HWND hwndDlg, PDATA pData) pData->PrevWindowPi.hThread = pData->PrevWindowPi.hProcess = NULL; } - if (WaitForSettingsDialog(hwndDlg, pi.hProcess)) - SetScreenSaverPreviewBox(hwndDlg, pData); + WaitForSettingsDialog(hwndDlg, pi.hProcess); + SetScreenSaverPreviewBox(hwndDlg, pData); CloseHandle(pi.hProcess); CloseHandle(pi.hThread);