Bind Win32 main-thread queue to runtime state

This commit is contained in:
2026-06-17 11:38:43 +02:00
parent 0cf6a6ea4f
commit 9602196e99
6 changed files with 31 additions and 4 deletions

View File

@@ -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;
}
}