mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-11-13 01:29:41 +01:00
Windows: Don't freeze the UI thread for a sec while launching a URL
This commit is contained in:
1 parent
48852ed81d
commit
1056547c70
1 file changed
+6
-1
+6
-1
@@ -133,7 +133,12 @@ static double g_lastKeepAwake = 0.0;
|
||||
static constexpr double ACTIVITY_IDLE_TIMEOUT = 2.0 * 3600.0;
|
||||
|
||||
void System_LaunchUrl(LaunchUrlType urlType, const char *url) {
|
||||
ShellExecute(NULL, L"open", ConvertUTF8ToWString(url).c_str(), NULL, NULL, SW_SHOWNORMAL);
|
||||
std::string u(url);
|
||||
std::thread t = std::thread([u]() {
|
||||
ShellExecute(NULL, L"open", ConvertUTF8ToWString(u).c_str(), NULL, NULL, SW_SHOWNORMAL);
|
||||
});
|
||||
// Detach is bad (given exit behavior), but in this case all the thread does is a ShellExecute to avoid freezing the caller while it runs, so it's safe.
|
||||
t.detach();
|
||||
}
|
||||
|
||||
void System_Vibrate(int length_ms) {
|
||||
|
||||
Reference in new issue
Block a user