Repository navigation
Conversation
Skiko's native disableTitlebar does dispatch_sync to the main queue. When MacTitleBarEffect calls it on the EDT while the AppKit main thread is in LWCToolkit's nested run loop waiting for the EDT, both threads wait on each other and the UI freezes permanently. Run the call on Dispatchers.IO so only a background thread blocks. Refs NihilDigit#69 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
All contributors have signed the CLA ✍️ ✅ |
Author
|
I have read the CLA Document and I hereby sign the CLA |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Refs #69
Problem
On macOS, Piko can freeze permanently when a window (e.g. the player / clip preview) is shown. A
sampleof the frozen process (posted in #69) shows:AWT-EventQueue-0blocked in Skiko's-[LayerHandler disableTitlebar:]→dispatch_sync(dispatch_get_main_queue(), …)LWCToolkit.doAWTRunLoop(nested run loop injavaRunLoopMode, which doesn't drain the GCD main queue), waiting for the EDTSo the EDT waits for the main queue while the main thread waits for the EDT.
Change
MacTitleBarEffectnow runsdisableTitleBar()onDispatchers.IOinstead of the EDT, so only a background thread blocks ondispatch_sync. The main thread can finish its nested loop and then run the block. The rest of the effect (waiting forisShowing,MacOs.patchTitleBarDoubleClick()) is unchanged.Testing
:desktopApp:compileKotlinDesktopfrom the v1.7.0 tag with this change (macOS 27.3, Apple M4) and swapped the two changed classes into an installed 1.7.0 build. The app starts normally and the custom title bar is applied as before.desktopMainonly.Note
Skiko's native lookup iterates its global
layerStorage, which is otherwise mutated on the EDT, so calling it off the EDT has a small theoretical race. A cleaner fix might belong in Skiko itself. @K-MarkLee is also trying a "call before the window is shown" approach in #69; the two could be combined.🤖 Generated with Claude Code