Bind Win32 main-thread queue to runtime state
This commit is contained in:
@@ -5,6 +5,7 @@
|
||||
#include "platform_windows/windows_main_window_session.h"
|
||||
#include "platform_windows/windows_platform_services.h"
|
||||
#include "platform_windows/windows_runtime_shell.h"
|
||||
#include "platform_windows/windows_runtime_state.h"
|
||||
#include "keymap.h"
|
||||
#include "platform_windows/windows_stylus_input.h"
|
||||
#include "platform_windows/windows_window_shell.h"
|
||||
@@ -142,9 +143,9 @@ namespace {
|
||||
|
||||
void enqueue_main_thread_task(std::packaged_task<void()> task)
|
||||
{
|
||||
if (auto* app = bound_app())
|
||||
if (auto* runtime = retained_bound_runtime())
|
||||
{
|
||||
app->runtime().main_thread_task(std::move(task));
|
||||
runtime->main_thread_task(std::move(task));
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -156,9 +157,9 @@ void enqueue_main_thread_task(std::packaged_task<void()> task)
|
||||
|
||||
void drain_main_thread_tasks()
|
||||
{
|
||||
if (auto* app = bound_app())
|
||||
if (auto* runtime = retained_bound_runtime())
|
||||
{
|
||||
app->runtime().drain_main_thread_tasks();
|
||||
runtime->drain_main_thread_tasks();
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user