Add facility to run callbacks on the window thread

This commit is contained in:
Henrik Rydgård committed 2024-04-06 12:14:29 +02:00
1 parent 616ee81f84
commit 9ec5efdcc5
6 files changed
+31 -2

No files matched your search

+7 -1
View File
@@ -636,7 +636,13 @@ bool System_MakeRequest(SystemRequestType type, int requestId, const std::string
}
case SystemRequestType::CREATE_GAME_SHORTCUT:
return W32Util::CreateDesktopShortcut(param1, param2);
case SystemRequestType::RUN_CALLBACK_IN_WNDPROC:
{
auto func = reinterpret_cast<void (*)(void *window, void *userdata)>(param3);
void *userdata = reinterpret_cast<void *>(param4);
MainWindow::RunCallbackInWndProc(func, userdata);
return true;
}
default:
return false;
}