Skip to content

Defer Emscripten window events during a frame - #183

Closed
relh wants to merge 1 commit into
treeform:masterfrom
relh:relh/defer-emscripten-window-events
Closed

Defer Emscripten window events during a frame#183
relh wants to merge 1 commit into
treeform:masterfrom
relh:relh/defer-emscripten-window-events

Conversation

@relh

@relh relh commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

What changed

Focus, blur, and resize events that arrive while Asyncify has suspended onFrame are queued until the frame returns. This keeps window callbacks from changing state in the middle of a frame.

Check

  • nim c -d:emscripten examples/basic.nim with Emscripten 6.0.2

Focus and resize events can arrive while Asyncify has suspended onFrame. Queue those callbacks until onFrame returns so window state changes at a frame boundary.
@treeform

treeform commented Sep 6, 2026

Copy link
Copy Markdown
Owner

Closing this PR because its changes were already included in #185 ("Fix double click never firing on emscripten"), merged into master on August 6, 2026 as d6ee2c9.

Verified the complete patch against that merged commit and checked the current master implementation: frameDispatchActive guards onFrame, resize and focus callbacks are deferred while the frame is active, and the pending events are drained after the frame returns.

The fix has already landed through #185, so no separate merge is needed. Thanks for the contribution!

@treeform treeform closed this Sep 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants