FancyMenu [Fabric] [MOVED TO NEW PROJECT]

FancyMenu [Fabric] [MOVED TO NEW PROJECT]

17M Downloads

[macOS specific, likely effects both loaders] Apple AWT Internal Exception: NSWindow drag regions should only be invalidated on the Main Thread!

cocona20xx opened this issue · 8 comments

commented

This bug (tested on the forge ver. of the mod v2.0.7) seems to occur when a mod attempts to change certain properties of the game window from outside the main thread (specifically in this case, drag regions). This bug happened with Optifine in the past (see sp614x/optifine#4809 ) and is likely caused by this quirk of Apple's specifications on UI elements, in that they are only able to be modified from the main thread as stated earlier. ( adoptium/adoptium-support#101 )

Log (from modpack Permafrost): https://paste.ee/p/BaheJ
Log 2 (using Permafrost title screen files but otherwise a clean install): https://paste.ee/p/U39Hq

What versions does this occur on: Likely all versions of your codebase capable of making these types of changes will trigger this crash on macOS versions when the JVM is compiled against a relatively newer version of Xcode tools (10.15.x Catalina).

Since these newer versions of the JVM are going to be more and more common from now on, this is a pretty big issue.

For end users: until a bug fix is dropped, macOS users who run into this problem when playing a modpack should probably just disable this mod, as it (typically) doesn't change gameplay.

commented

Hi! Thank you very much for that detailed issue report, tried to fix this for months without success. I thought it’s happening randomly and I can’t fix it.

Problem is, from my understanding, this is related to altering drag regions of the window, but I never do this. Only thing I do is altering the window icon and text, which is most likely what causes this, but I use the same methods Minecraft is using to do the same. I’m on the same thread as Minecraft when calling these methods.

I can’t really do more than disabling all window-related features in macOS to fix this :/

commented

MinecraftForge/MinecraftForge#7546

Do you do anything that directly resizes the game window; or implement your own version of the fix listed above? It only occurs under windows and so should disable itself if not on that OS. This is believed to be the main way to fix the side-effect bug causing this crash. Otherwise you might have to disable window-related features, yes.

commented

Nope, nothing that changes the window size. Will try to disable all window stuff, thank you for your help!

commented

Hi again! I maybe found a fix for the problem, but I can't test it because I don't have a system with macOS 11+ available.
Could you please check if you can launch the game using THIS version of FancyMenu? It's basically the current version with only the new fix added. Thank you very much!

commented

Great to hear, thank you very much! :D
Will close it after I've released the fix :)

commented

Sorry for replying late; but yeah i'll try it rn actually

commented

@Keksuccino HOLY SHIT it actually works flawlessly, gj
feel free to close this issue when you update the main build lmao

commented

Fixed in FancyMenu v2.1.0! Thank you for your report!