mirror of
https://github.com/hrydgard/ppsspp.git
synced 2025-04-02 11:01:50 -04:00
More confirmexit fixes
This commit is contained in:
parent
dd119f5971
commit
74ee868cdb
4 changed files with 10 additions and 7 deletions
|
@ -819,12 +819,12 @@ namespace MainWindow
|
||||||
bool ConfirmExit(HWND hWnd) {
|
bool ConfirmExit(HWND hWnd) {
|
||||||
const GlobalUIState state = GetUIState();
|
const GlobalUIState state = GetUIState();
|
||||||
if (state == UISTATE_MENU || state == UISTATE_EXIT) {
|
if (state == UISTATE_MENU || state == UISTATE_EXIT) {
|
||||||
return false;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string confirmExitMessage = GetConfirmExitMessage();
|
std::string confirmExitMessage = GetConfirmExitMessage();
|
||||||
if (confirmExitMessage.empty()) {
|
if (confirmExitMessage.empty()) {
|
||||||
return false;
|
return true;
|
||||||
}
|
}
|
||||||
auto di = GetI18NCategory(I18NCat::DIALOG);
|
auto di = GetI18NCategory(I18NCat::DIALOG);
|
||||||
auto mm = GetI18NCategory(I18NCat::MAINMENU);
|
auto mm = GetI18NCategory(I18NCat::MAINMENU);
|
||||||
|
@ -1161,6 +1161,10 @@ namespace MainWindow
|
||||||
UpdateSwitchUMD();
|
UpdateSwitchUMD();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case WM_USER_DESTROY:
|
||||||
|
DestroyWindow(hWnd);
|
||||||
|
break;
|
||||||
|
|
||||||
case WM_MENUSELECT:
|
case WM_MENUSELECT:
|
||||||
// Called when a menu is opened. Also when an item is selected, but meh.
|
// Called when a menu is opened. Also when an item is selected, but meh.
|
||||||
UpdateMenus(true);
|
UpdateMenus(true);
|
||||||
|
|
|
@ -20,6 +20,7 @@ namespace MainWindow
|
||||||
WM_USER_RESTART_EMUTHREAD = WM_USER + 106,
|
WM_USER_RESTART_EMUTHREAD = WM_USER + 106,
|
||||||
WM_USER_SWITCHUMD_UPDATED = WM_USER + 107,
|
WM_USER_SWITCHUMD_UPDATED = WM_USER + 107,
|
||||||
WM_USER_RUN_CALLBACK = WM_USER + 108,
|
WM_USER_RUN_CALLBACK = WM_USER + 108,
|
||||||
|
WM_USER_DESTROY = WM_USER + 109,
|
||||||
};
|
};
|
||||||
|
|
||||||
enum {
|
enum {
|
||||||
|
|
|
@ -443,7 +443,7 @@ namespace MainWindow {
|
||||||
PostMessage(MainWindow::GetHWND(), WM_USER_RESTART_EMUTHREAD, 0, 0);
|
PostMessage(MainWindow::GetHWND(), WM_USER_RESTART_EMUTHREAD, 0, 0);
|
||||||
} else {
|
} else {
|
||||||
g_Config.bRestartRequired = true;
|
g_Config.bRestartRequired = true;
|
||||||
DestroyWindow(MainWindow::GetHWND());
|
PostMessage(MainWindow::GetHWND(), WM_USER_DESTROY, 0, 0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -537,8 +537,7 @@ bool System_MakeRequest(SystemRequestType type, int requestId, const std::string
|
||||||
switch (type) {
|
switch (type) {
|
||||||
case SystemRequestType::EXIT_APP:
|
case SystemRequestType::EXIT_APP:
|
||||||
if (!NativeIsRestarting()) {
|
if (!NativeIsRestarting()) {
|
||||||
// Not on the window thread here, so postmessage wm_close is pretty reasonable.
|
PostMessage(MainWindow::GetHWND(), MainWindow::WM_USER_DESTROY, 0, 0);
|
||||||
PostMessage(MainWindow::GetHWND(), WM_CLOSE, 0, 0);
|
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
case SystemRequestType::RESTART_APP:
|
case SystemRequestType::RESTART_APP:
|
||||||
|
@ -550,8 +549,7 @@ bool System_MakeRequest(SystemRequestType type, int requestId, const std::string
|
||||||
PostMessage(MainWindow::GetHWND(), MainWindow::WM_USER_RESTART_EMUTHREAD, 0, 0);
|
PostMessage(MainWindow::GetHWND(), MainWindow::WM_USER_RESTART_EMUTHREAD, 0, 0);
|
||||||
} else {
|
} else {
|
||||||
g_Config.bRestartRequired = true;
|
g_Config.bRestartRequired = true;
|
||||||
// Not on the window thread here, so postmessage wm_close is pretty reasonable.
|
PostMessage(MainWindow::GetHWND(), MainWindow::WM_USER_DESTROY, 0, 0);
|
||||||
PostMessage(MainWindow::GetHWND(), WM_CLOSE, 0, 0);
|
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue