Skip to content

Retire the AWT/JBR/JNI window backends, leaving only Tao - #593

Open
kdroidFilter wants to merge 1 commit into
mainfrom
feat/retire-awt-backends
Open

Retire the AWT/JBR/JNI window backends, leaving only Tao#593
kdroidFilter wants to merge 1 commit into
mainfrom
feat/retire-awt-backends

Conversation

@kdroidFilter

Copy link
Copy Markdown
Collaborator

Tao becomes the single window backend. decorated-window-awt, decorated-window-jbr and decorated-window-jni are deleted with their native sources, API dumps, detekt baselines and GraalVM reachability metadata, along with the jni-demo sample (~10k lines removed).

Summary

  • Modules removed: decorated-window-awt, decorated-window-jbr, decorated-window-jni, examples/jni-demo (+ settings.gradle.kts / apiValidation wiring, the jbr-api version-catalog entry, the jni/jbr native build steps and verify entries in build-natives / pre-merge / publish-maven).
  • nucleus-application: drops the AWT application scope, window and dialog adapters; decorated-window-tao moves from compileOnly to api, since the backend is no longer a consumer choice and a missing runtime module would otherwise only fail at launch.
  • Theme modules: the AWT overloads of MaterialDecoratedWindow / MaterialDecoratedDialog (M2 + M3) and JewelDecoratedWindow / JewelDecoratedDialog are gone — only the NucleusApplicationScope receivers remain, which also retires the LowPriorityInOverloadResolution / INVISIBLE_REFERENCE workarounds they required. material2's dialog existed only in AWT form, so it is ported to a NucleusApplicationScope receiver to keep parity with M3.
  • taskbar-progress-tao: single Tao dispatch path instead of the AWT/Tao fork.
  • core-runtime keeps WindowBackend.Awt: it still describes a plain Compose Desktop / Swing host that embeds Nucleus libraries. The plugin's jbr-api ProGuard keep and AOT unsealing workarounds also stay, since an app can still ship jbr-api itself.
  • Demos migrated: scheduler-demo jni → Tao (drops the java.desktop/sun.* add-opens); service-management-demo swaps java.awt.EventQueue for rememberCoroutineScope().launch, because SMAppService completion handlers must now hop to the Tao main thread. The backend = NucleusBackend.Tao argument is dropped from the eight other demos.
  • Docs: README (module table, project status, migration note), CLAUDE.md, and the ~37 dangling decorated-window-jni / -jbr / -awt references in Tao's KDoc and comments.
  • Drive-by: rect-stress-demo and widget-demo are added to apiValidation.ignoredProjects alongside the other demos, fixing their pre-existing apiCheck failures.

Breaking changes

Removed from the public API (apiDump regenerated):

  • NucleusBackend, LocalNucleusBackend, nucleusApplication(backend = …), NucleusApplicationScope.backend
  • NucleusWindowUnsafe.awtWindow / awtDialog
  • the ApplicationScope / receiver-less AWT overloads in the Material 2, Material 3 and Jewel modules

Migration: depend on nucleus.decorated-window-tao, drop the backend = argument, and replace AWT-typed window access and Compose Desktop's Window / Dialog / Tray with nucleusWindow, HostedWindow / HostedDialog and an AWT-free tray. Documented in the README's project-status section.

Docs describe the removal as landing in 2.6v2.5.0 is already tagged without it. Three occurrences to change if this should ship as 3.0.0 instead.

Test plan

  • ./gradlew testClasses — every module and demo compiles
  • ./gradlew test — all unit tests pass (NucleusApplicationScopeTest ported to the Tao scope)
  • ./gradlew apiCheck / apiDump committed
  • ./gradlew ktlintCheck detekt — clean, no baseline regeneration
  • ./gradlew preMerge — green except plugin-build's LinuxSignerTest, which fails on gpg --gen-key locally and reproduces identically on a clean worktree at main (pre-existing, environmental)
  • Headful run of scheduler-demo on macOS/JDK 25 — Jewel window renders with native traffic lights
  • Headful run of service-management-demo on macOS/JDK 25 — Material 3 window renders, SMAppService: Available
  • CI: Linux and Windows native builds + packaging

Tao is now the single window backend. Removes the three AWT-based modules
(`decorated-window-awt`, `-jbr`, `-jni`) with their native sources, API
dumps, detekt baselines and GraalVM metadata, plus the `jni-demo` sample.

BREAKING CHANGE: `NucleusBackend`, `LocalNucleusBackend`, the `backend =`
parameter of `nucleusApplication`, `NucleusApplicationScope.backend` and
`NucleusWindowUnsafe.awtWindow` / `awtDialog` are gone, as are the AWT
overloads of `MaterialDecoratedWindow` / `MaterialDecoratedDialog` (M2, M3)
and `JewelDecoratedWindow` / `JewelDecoratedDialog` — only the
`NucleusApplicationScope` receivers remain. Compose Desktop's AWT `Window`,
`Dialog` and `Tray` are unsupported; use `DecoratedWindow`, `HostedWindow` /
`HostedDialog` and an AWT-free tray.

- nucleus-application: drops the AWT scope/window/dialog adapters and takes
  `api(project(":decorated-window-tao"))`, since the backend is no longer a
  consumer choice and a missing runtime module would only fail at launch
- material2: ports `MaterialDecoratedDialog` to a `NucleusApplicationScope`
  receiver — it existed only in AWT form, so M2 keeps parity with M3
- removing the AWT overloads also retires the `LowPriorityInOverloadResolution`
  / `INVISIBLE_REFERENCE` workarounds they needed
- taskbar-progress-tao: single Tao dispatch path
- core-runtime keeps `WindowBackend.Awt`: it still describes a plain Compose
  Desktop / Swing host embedding Nucleus libraries
- scheduler-demo moves to Tao (drops the `java.desktop/sun.*` add-opens);
  service-management-demo swaps `java.awt.EventQueue` for
  `rememberCoroutineScope().launch`, as SMAppService completion handlers must
  hop to the Tao main thread
- drops the now-unused `jbr-api` catalog entry, the jni/jbr native build steps
  and verify entries from CI, and rewrites the backend docs
- also adds `rect-stress-demo` / `widget-demo` to `apiValidation.ignoredProjects`
  alongside the other demos, fixing their pre-existing `apiCheck` failures
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