On Sat, 22 Mar 2025 18:05:13 GMT, Martin Fox <m...@openjdk.org> wrote:

>> modules/javafx.graphics/src/main/native-glass/mac/GlassApplication.m line 
>> 759:
>> 
>>> 757: + (BOOL)canStartNestedEventLoop
>>> 758: {
>>> 759:     return nestedRunLoopRunCount <= 250;
>> 
>> would it be possible to determine the source of this limit - a header 
>> perhaps?
>> could it be dependent on os version?
>
> I have not been able to find any header detailing this limit. My guess is 
> that someone at Apple decided to add an internal check for infinite recursion 
> to ensure the app fails early with a clear message and decided 255 levels of 
> nesting should be enough for anyone. The crash log contains these lines 
> (which also show up in the debugger):
> 
>> Application Specific Information:
>> Too many nested CFRunLoopRuns
> 
> The check is new with macOS 15. I tested some standalone code on macOS 13 and 
> 14 and had no problem reaching a nesting level of 500. But I don't think we 
> should make the JavaFX check conditional on OS version number; I wouldn't 
> want a JavaFX app that worked on macOS 14 to fail mysteriously on macOS 15.

I second Kevin's suggestion to add a constant with a good comment, since it's 
an arbitrarily chosen limit.  It would explain the "why" if/when the things 
change in macOS.

-------------

PR Review Comment: https://git.openjdk.org/jfx/pull/1741#discussion_r2010372776

Reply via email to