New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
DolphinWX: Shut down cleanly on shutdown signal #3991
Conversation
I like the idea, but the implementation is not great for multiple reasons:
|
@@ -353,6 +357,10 @@ bool CFrame::InitControllers() | |||
return false; | |||
} | |||
|
|||
#if defined(__unix__) || defined(__unix) || defined(__APPLE__) | |||
static std::atomic_bool s_sigint_received; |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
This makes DolphinWX shut down cleanly, just like it would with File->Exit when it receives a SIGINT, SIGTERM (Unix) or some signals on Windows. The default signal handler will be restored after a first shutdown signal so a second signal will exit Dolphin forcefully.
@leoetlino: This comment grants you the permission to merge this pull request whenever you think it is ready. After addressing the remaining comments, click this link to merge. LGTM. Feel free to merge when you've tested the Windows path. @dolphin-emu-bot allowmerge |
I tested it on Windows, but couldn't really trigger the ctrl console handler because Dolphin is built to be a GUI application on Windows and GUI apps cannot have a console at the same time… but I guess it would work in headless mode? Other than that, tested and works as expected on Linux, and has no effect on Windows unless Dolphin is built as a console application. |
Wrong! 😜 You can use https://justcheckingonall.wordpress.com/2008/08/29/console-window-win32-app/. |
Well, technically you can, but that'd just be "fak[ing] it", and it's not really worth it in this case. |
This is the same as PR dolphin-emu#3991, but for MainNoGUI. nogui/headless will shut down cleanly on SIGINT, SIGTERM (Unix) or some other shutdown signals on Windows, just like it would when closing the render window. The default signal handler will be restored after a first shutdown signal so a second signal will exit Dolphin forcefully.
This is the same as PR dolphin-emu#3991, but for MainNoGUI. nogui/headless will shut down cleanly on SIGINT, SIGTERM (Unix) or some other shutdown signals on Windows, just like it would when closing the render window. The default signal handler will be restored after a first shutdown signal so a second signal will exit Dolphin forcefully.
This is the same as PR dolphin-emu#3991, but for MainNoGUI. nogui/headless will shut down cleanly on SIGINT, SIGTERM (Unix) or some other shutdown signals on Windows, just like it would when closing the render window. The default signal handler will be restored after a first shutdown signal so a second signal will exit Dolphin forcefully.
This is the same as PR dolphin-emu#3991, but for MainNoGUI. nogui/headless will shut down cleanly on SIGINT and SIGTERM, just like it would when closing the render window. The default signal handler will be restored after a first shutdown signal so a second signal will exit Dolphin forcefully.
This makes DolphinWX shut down cleanly, just like it would with File->Exit or closing the main window.
I'm not sure if this should bypass Confirm on Stop or not (currently, it doesn't).
This change is