signal: show Windows popup window on crash (#410)

## Link to GitHub Issue, if one exists
#345 

## Description of change
Show a MessageBox when signal detects a crash.

## Testing
Tested full screen and windowed games.
This commit is contained in:
bicarus-dev
2025-10-31 20:54:56 -07:00
committed by GitHub
parent 13a0877d38
commit 537252440e
5 changed files with 40 additions and 1 deletions
+13
View File
@@ -1,5 +1,6 @@
#include "signal.h"
#include <future>
#include <exception>
#include <windows.h>
@@ -174,6 +175,18 @@ static LONG WINAPI TopLevelExceptionFilter(struct _EXCEPTION_POINTERS *Exception
log_warning("signal", "minidump creation function not available, skipping");
}
// reduce sleep time since we will wait for the user to acknowledge the popup
LOG_FATAL_SLEEP = 1;
// in 30 seconds, shut down (in case user can't dismiss popup)
const auto f = std::async(std::launch::async, [] {
std::this_thread::sleep_for(std::chrono::seconds(30));
log_fatal("signal", "end");
});
// this will stall all UI threads for this process
deferredlogs::show_popup_for_crash();
log_fatal("signal", "end");
}