webui-dev / webui

Use any web browser or WebView as GUI, with your preferred language in the backend and modern web technologies in the frontend, all in a lightweight portable library.
https://webui.me
MIT License
2.9k stars 164 forks source link

Text editor example is crashing on macos #213

Closed ttytm closed 11 months ago

ttytm commented 11 months ago

Hitting the open button in the text editor example results in a crash.

2023-09-21 14:41:59.642 text-editor[90582:1550658] *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'NSWindow drag regions should only 
be invalidated on the Main Thread!'
*** First throw call stack:
(
        0   CoreFoundation                      0x0000000192deb154 __exceptionPreprocess + 176
        1   libobjc.A.dylib                     0x000000019290a4d4 objc_exception_throw + 60
        2   CoreFoundation                      0x0000000192e143a0 _CFBundleGetValueForInfoKey + 0
        3   AppKit                              0x0000000195fba638 -[NSWindow(NSWindow_Theme) _postWindowNeedsToResetDragMarginsUnlessPostingDisabled] + 320
        4   AppKit                              0x0000000195fa890c -[NSWindow _initContent:styleMask:backing:defer:contentView:] + 816
        5   AppKit                              0x0000000196102ce8 -[NSPanel _initContent:styleMask:backing:defer:contentView:] + 48
        6   AppKit                              0x0000000195fa85d0 -[NSWindow initWithContentRect:styleMask:backing:defer:] + 48
        7   AppKit                              0x0000000196102c9c -[NSPanel initWithContentRect:styleMask:backing:defer:] + 48
        8   AppKit                              0x00000001968e5ce4 -[NSSavePanel initWithContentRect:styleMask:backing:defer:] + 120
        9   AppKit                              0x00000001968c0d44 -[NSOpenPanel initWithContentRect:styleMask:backing:defer:] + 152
        10  AppKit                              0x00000001968e5c58 -[NSSavePanel init] + 228
        11  AppKit                              0x00000001965c16e8 +[NSSavePanel(Instantiation) _crunchyRawUnbonedPanel] + 88
        12  text-editor                         0x00000001021959f8 text-editor + 6648
        13  text-editor                         0x0000000102195b20 text-editor + 6944
        14  text-editor                         0x000000010219b658 text-editor + 30296
        15  libsystem_pthread.dylib             0x0000000192c93fa8 _pthread_start + 148
        16  libsystem_pthread.dylib             0x0000000192c8eda0 thread_start + 8
)
libc++abi: terminating due to uncaught exception of type NSException
fish: Job 1, './text-editor' terminated by signal SIGABRT (Abort)
Apple clang version 14.0.3 (clang-1403.0.22.14.1)
Target: arm64-apple-darwin22.6.0
hassandraga commented 11 months ago

This crash happened in the V example?

ttytm commented 11 months ago

The crash happens with C.

Opening didn't files crashed with V. There were just file saving problems, that were fixed with the recent commit.

hassandraga commented 11 months ago

This issue happens often or one time?

ttytm commented 11 months ago

It always happens always after a few seconds when pressing the open icon.

Edit: It's the button area around the icon that needs to be clicked. Clicking the icon directly has no effect, which probably is a separate issue. Separate issue fixed in #214