[UI] Loop thread to main thread WindowedAppContext
This commit is contained in:
@@ -15,6 +15,7 @@
|
||||
#include "xenia/kernel/xam/xam_private.h"
|
||||
#include "xenia/ui/imgui_dialog.h"
|
||||
#include "xenia/ui/window.h"
|
||||
#include "xenia/ui/windowed_app_context.h"
|
||||
#include "xenia/xbox.h"
|
||||
|
||||
namespace xe {
|
||||
@@ -50,15 +51,16 @@ dword_result_t XamShowNuiTroubleshooterUI(unknown_t unk1, unknown_t unk2,
|
||||
|
||||
auto display_window = kernel_state()->emulator()->display_window();
|
||||
xe::threading::Fence fence;
|
||||
display_window->loop()->PostSynchronous([&]() {
|
||||
xe::ui::ImGuiDialog::ShowMessageBox(
|
||||
display_window, "NUI Troubleshooter",
|
||||
"The game has indicated there is a problem with NUI (Kinect).")
|
||||
->Then(&fence);
|
||||
});
|
||||
++xam_dialogs_shown_;
|
||||
fence.Wait();
|
||||
--xam_dialogs_shown_;
|
||||
if (display_window->app_context().CallInUIThreadSynchronous([&]() {
|
||||
xe::ui::ImGuiDialog::ShowMessageBox(
|
||||
display_window, "NUI Troubleshooter",
|
||||
"The game has indicated there is a problem with NUI (Kinect).")
|
||||
->Then(&fence);
|
||||
})) {
|
||||
++xam_dialogs_shown_;
|
||||
fence.Wait();
|
||||
--xam_dialogs_shown_;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user