Skip to content

Feat: Take the Java toolkit off the Linux GraalVM image, and give macOS the same main dispatcher (follows #173, #184) - #204

Merged
b-re-w merged 19 commits into
developfrom
feat/awt-free-linux-dispatcher
Oct 5, 2026
Merged

b-re-w merged 19 commits into
developfrom
feat/awt-free-linux-dispatcher

Conversation

@b-re-w

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

Copy link
Copy Markdown
Member

Work in progress, opened so #193 can build on FrameMainDispatcher. Not mergeable until the Linux GraalVM jobs pass.

  • FrameMainDispatcher: a Dispatchers.Main provider that runs once a frame in the X11 and AppKit loops; install() sets compose.main.dispatcher=coroutines (fork Move design-systems/ to the Compose fork #86 path). Set in one place per window branch of RendererEntryPoints.kt.
  • ToolkitWindow.available (-Ddxc.toolkit.window=false at image build) folds the toolkit window out of the image entry.
  • Toolkit reachability registrations moved to scripts/toolkit-metadata (Windows only).
  • build-compose.sh --target desktop publishes the fork's ui, ui-text and foundation desktop modules; the GraalVM workflow builds them once (compose-desktop job) and the image jobs read them first (desktop/module.yaml mavenLocal).
  • Guard: -H:ReportAnalysisForbiddenType=java.awt.Toolkit and linux-image-has-no-awt.test.sh.
    Currently iterating on remaining java.awt reachability with a call-tree probe commit (to be dropped).

b-re-w added 19 commits October 5, 2026 08:28
…e loop and leaves Swing's provider out

The probes showed the toolkit reached through the toolkit window's entry (folded out at
build time), and then only through Skiko's Swing dispatcher. The fork can send that work to
Dispatchers.Main (compose.main.dispatcher=coroutines); FrameMainDispatcher answers there and
runs once a frame in the X11 loop. The fork's desktop modules are built once in CI and the
Linux jobs read them first. build-compose.sh pins the fork at the commit holding the
AWT-free changes and has a desktop target.
…frame, and the Linux image is checked for toolkit libraries
… on the Linux image

The fork reads a String nativeClipboard for Paste, but renderer tests and macOS keep the
toolkit's type. -Ddxc.awt.clipboard=false (Linux image only) selects the plain one at build time.
…x image, and let the smoke test prove nothing loads them

The fork's AWT clipboard fallback and similar branches keep java.desktop classes reachable
although nothing runs them, so reachability cannot be the guard. Running the image without
the libraries is.
@b-re-w
b-re-w merged commit aa9d2e4 into develop Oct 5, 2026
18 checks passed
@b-re-w
b-re-w deleted the feat/awt-free-linux-dispatcher branch October 5, 2026 10:02
b-re-w added a commit that referenced this pull request Oct 5, 2026
Feat: Switch the toolkit out of the Linux image with the fork's ExtendedAwt, check its ways in, drop the libjawt stub (follows #204)
b-re-w added a commit that referenced this pull request Oct 17, 2026
… Compose's main-thread work in the Win32 frame loop

The Windows image ran Compose's main-thread work on Swing
(kotlinx.coroutines.swing.Swing, compose.main.dispatcher=unset, run
39014707510) and carried the whole AWT stack, now that it opens its own
window by default. As the macOS and Linux images do (#193, #204, #205,
#208 to #210):
- the Win32 branch sets java.awt.headless, installs FrameMainDispatcher,
  and the frame loop and the resize frame run its pending work first;
- the scene gets the window's own clipboard, as NativeWindowContent gives
  the AppKit and X11 windows;
- build-native-windows.ps1 builds with -Ddxc.toolkit.window=false,
  -Dcompose.awt=false and -Ddxc.awt.clipboard=false, forbids
  java.awt.Toolkit and java.awt.Component, leaves kotlinx-coroutines-swing
  off the class path, drops the ImeReachabilityFeature, the preserved
  java.desktop module and the toolkit's reachability metadata (kept for
  the development shell), removes the toolkit libraries Native Image
  stages, and puts a stub jawt.dll (win32_jawt_stub.c) beside skiko's
  library when that library imports it;
- windows-build-contract.test.sh states the new contract.
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