Skip to content

Refactor: Use the Win32 window from the fork's graalvm-windows module (#163, #69) - #268

Closed
b-re-w wants to merge 1 commit into
developfrom
feat/win32-window-from-fork
Closed

b-re-w wants to merge 1 commit into
developfrom
feat/win32-window-from-fork

Conversation

@b-re-w

@b-re-w b-re-w commented Oct 24, 2026

Copy link
Copy Markdown
Member

Stage 1 (Win32) of #163, and the fix for #69. Draft: it depends on the fork PR thisisthepy/compose-multiplatform-core-extended#161 and on a pin bump.

What

renderer/desktop/src/Win32Window.kt keeps only the glue: runWin32Window, the scene, drawFrame and drawRasterFrame. Everything else moved to the fork's new graalvm-windows module (the @CFunction externs, Win32GraalWindow, Win32Frames, RasterTarget, the event drain, describeTo, the draw upcall).

  • Deleted: Win32DrawCallback.java, Win32FrameTest, Win32AccessibilityTest (they moved to the fork).
  • native-image.properties and build-native-windows.ps1 initialize org.thisisthepy.compose.window.graalvm.windows.Win32DrawCallback at build time.
  • renderer/desktop/module.yaml and renderer/scripts/publish-window.sh gain graalvm-windows.
  • AppKitWindow.kt imports Win32Frames from the fork, because the macOS loop shares that door.
  • Shell tests retargeted to the fork file: win32-window-layout, win32-renderer-parity, desktop-c-symbols.
  • Win32ImeKeyTest stays: win32ComposeKey returns a Compose Key and the fork module names no Compose type.

Frame time (#69)

The window's frameTimeNanos() (a FrameClock on monotonicNanos) replaces nanos += FRAME_NANOS in the native image path. The same fix is applied in renderer/windows/src/Win32Window.kt, because the Kotlin/Native Windows scene stays in compose-rust until a later stage. No fixed 16 ms step remains.

TODO before this can merge

  • The pin (WINDOW_REVISION in renderer/scripts/build-compose.sh) moves after the fork PR merges, in a separate pin-bump PR. Until then the three retargeted shell tests read the old pinned fork, which has no graalvm-windows, so they fail here. Run against the fork branch with the fetch stubbed, win32-window-layout and win32-renderer-parity pass; desktop-c-symbols passes for Linux and Windows (its macOS result differs with a newer fork than the pin, independent of this change).
  • renderer/scripts/compose-fork.changes is part of the pin bump and is not touched here.

Needs a Windows build to verify

Nothing here was built (no Amper, Gradle, cargo or native-image).

  • The renderer compiles against graalvm-windows and the native image links (dxc_win32_draw_frame entry point, initialize-at-build-time of the moved class).
  • Resize drag still draws through the upcall, CPU and GPU frames.
  • Animation speed follows the wall clock on the native image and on the Kotlin/Native Windows renderer.
  • macOS and Linux images still build with the extra module.

…#163), time K/N frames by clock (#69)

The native image's Win32 window (externs, Win32GraalWindow, Win32Frames, event drain,
describeTo, draw upcall) is now the fork's graalvm-windows module. Win32Window.kt keeps the
scene and Host wiring. Frame time comes from the window's FrameClock on the monotonic clock
instead of nanos += 16 ms; the Kotlin/Native Windows scene gets the same FrameClock.
Win32FrameTest and Win32AccessibilityTest moved with the code.
@b-re-w

b-re-w commented Oct 25, 2026

Copy link
Copy Markdown
Member Author

Handoff (2026-10-25): Branch: feat/win32-window-from-fork. State: draft; GraalVM smoke (Linux arm64, Linux x64, macOS arm64), jvm build, shell tests (macOS and Ubuntu) and Heavy checks are red. Next: after fork PR #161 merges, repin, then fix the shell tests and the smoke failures. Blocked on: fork PR #161 merge and repin.

@b-re-w

b-re-w commented Nov 7, 2026

Copy link
Copy Markdown
Member Author

Closed during the 2026-11-07 branch consolidation (integrated via #505 or superseded). Branch kept.

@b-re-w b-re-w closed this Nov 7, 2026
@b-re-w
b-re-w deleted the feat/win32-window-from-fork branch November 12, 2026 16:33
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.

1 participant