From a2ed744179bc9a6bbf8788bc5ab4089d0a8d68b9 Mon Sep 17 00:00:00 2001 From: Tobiasz Laskowski Date: Sat, 13 Dec 2025 11:20:17 +0000 Subject: [PATCH 1/2] Fix eventloop usage for haxe 5 --- src/lime/_internal/backend/native/NativeApplication.hx | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/lime/_internal/backend/native/NativeApplication.hx b/src/lime/_internal/backend/native/NativeApplication.hx index d4e2813adb..a259833b91 100644 --- a/src/lime/_internal/backend/native/NativeApplication.hx +++ b/src/lime/_internal/backend/native/NativeApplication.hx @@ -607,7 +607,11 @@ class NativeApplication #if (haxe_ver >= 4.2) #if target.threaded + #if (haxe_ver >= 5) + sys.thread.Thread.current().events.loopOnce(); + #else sys.thread.Thread.current().events.progress(); + #end #else // Duplicate code required because Haxe 3 can't handle // #if (haxe_ver >= 4.2 && target.threaded) From 8b7ee84ecf5dbbb5863a79dbf3957eaba6f8694b Mon Sep 17 00:00:00 2001 From: Tobiasz Laskowski Date: Sat, 13 Dec 2025 14:39:08 +0000 Subject: [PATCH 2/2] Fix haxe.MainLoop use for haxe 5 --- src/lime/system/JNI.hx | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/lime/system/JNI.hx b/src/lime/system/JNI.hx index b1a052022b..ce223c9926 100644 --- a/src/lime/system/JNI.hx +++ b/src/lime/system/JNI.hx @@ -466,9 +466,13 @@ class JNISafetyTools // Check the thread before running the function. f.expr = macro - if (!lime.system.JNI.JNISafetyTools.onMainThread()) - haxe.MainLoop.runInMainThread($i{field.name}.bind($a{args})) - else + if (!lime.system.JNI.JNISafetyTools.onMainThread()) { + #if haxe5 + haxe.EventLoop.main.run($i{field.name}.bind($a{args})); + #else + haxe.MainLoop.runInMainThread($i{field.name}.bind($a{args})); + #end + } else ${f.expr}; default: }