Skip to content

feat: Tao-only TrayApp with transparent standalone popup panel (Windows)#414

Open
kdroidFilter wants to merge 2 commits into
masterfrom
feat/trayapp-tao-standalone-panel
Open

feat: Tao-only TrayApp with transparent standalone popup panel (Windows)#414
kdroidFilter wants to merge 2 commits into
masterfrom
feat/trayapp-tao-standalone-panel

Conversation

@kdroidFilter

Copy link
Copy Markdown
Owner

What

TrayApp is now Tao-only: it must run inside nucleusApplication (Nucleus Tao backend) and the AWT implementation is gone. On Windows, the popup renders in a per-pixel transparent, ownerless, topmost native panel (TaoStandalonePopup from Nucleus 2.0.0-alpha-202607120006, published to Maven Central by NucleusFramework/Nucleus#301).

Behavior

Windows

  • No backing window anywhere — nothing in the taskbar, Alt-Tab or the task view.
  • Slide + fade animations composite over the desktop (steady 60 fps pacing, high-resolution timers only while visible).
  • Outside-click dismissal works everywhere: other applications, the desktop (global mouse hook on the Nucleus side).
  • Full keyboard support in the popup: text input including AZERTY AltGr characters, Backspace/Enter/arrows, focus on show (type immediately without clicking), I-beam cursor over text fields.
  • Always on top of other windows.

macOS / Linux

  • Opaque DecoratedWindow with focus-based dismissal, identical API. Same animation defaults (they run over the window background until the panel is ported). The porting plan is in docs/PLAN_MACOS_LINUX_PANEL.md.

API changes (breaking)

  • All 6 TrayApp overloads are now NucleusApplicationScope.TrayApp(...); content lost its scope receiver.
  • Requires the Tao backend (require(backend == NucleusBackend.Tao)).
  • Removed internals: AwtTrayInitializer, AwtTrayMenuBuilderImpl, the three per-platform OutsideClickWatchers, WindowVisibilityMonitor, WindowRaise.
  • Screen geometry is AWT-free (TrayScreenGeometry / TrayPosition on Nucleus TaoScreenGeometry).

Dependencies

  • Nucleus modules and Gradle plugin aligned on 2.0.0-alpha-202607120006 (Maven Central / Plugin Portal); mavenLocal wiring removed — a fresh clone builds.
  • New: nucleus.decorated-window-material3 for the demo's MaterialDecoratedWindow.

Demo

  • All entry points converted to nucleusApplication.
  • TrayAppDemo: MaterialDecoratedWindow + MaterialTitleBar, single instance enabled, SingleInstanceRestoreEffect re-opens the tray popup when a second instance launches.

Testing

Validated on Windows 11, JVM and GraalVM native image (Liberica NIK 25): popup display, animations, tray-click toggle, outside-click on other apps/desktop, text input (incl. AltGr), Backspace/arrows, cursor changes, topmost, single-instance restore. macOS/Linux paths compile but need a run on real machines.

Note: README.md still documents the pre-Tao API — follow-up PR.

Drops the AWT path entirely — TrayApp now requires the Nucleus Tao
backend (nucleusApplication) and consumes the published
2.0.0-alpha-202607120006 from Maven Central (mavenLocal wiring removed).

TrayApp:
- Windows: the popup renders in TaoStandalonePopup — an ownerless,
  topmost, per-pixel transparent native panel. No backing window in the
  taskbar/Alt-Tab/task view; slide+fade animations composite over the
  desktop; outside-click dismissal works over other applications and the
  desktop; full keyboard support (text input incl. AltGr, Backspace,
  arrows) and per-control cursors.
- macOS/Linux: opaque DecoratedWindow with focus-based dismissal, same
  API. Porting plan for the transparent panel lives in
  docs/PLAN_MACOS_LINUX_PANEL.md.
- All public overloads moved to NucleusApplicationScope receivers;
  screen geometry is AWT-free (TrayScreenGeometry/TrayPosition on
  Nucleus TaoScreenGeometry).

Removed: AwtTrayInitializer, AwtTrayMenuBuilderImpl, the three
per-platform OutsideClickWatchers, WindowVisibilityMonitor, WindowRaise.

Demo: all entry points converted to nucleusApplication; TrayAppDemo uses
MaterialDecoratedWindow/MaterialTitleBar, single instance enabled with
SingleInstanceRestoreEffect re-opening the tray popup on second launch.
Validated on Windows 11 on JVM and GraalVM native image.
Nucleus 2.0.0-alpha-202607120312 ships the macOS standalone popup panel
(ownerless NSPanel + CAMetalLayer), so macOS now joins Windows on
TrayAppImplPanel; Linux stays on the opaque Tao window.

- TrayApp: per-platform default transitions restored (Windows slide+fade,
  macOS/Linux plain fade, near-instant on KDE); the Windows-only tray
  stabilization wait + refreshPosition is gated to Windows; the position
  poll loop falls back to the corner heuristic if the tray never becomes
  ready before the deadline
- TrayPosition (mac/linux): anchor the popup at the work-area edge — the
  Tao work area already excludes the menu bar/panel, so the old 28px
  bar guess (calibrated against AWT full-screen bounds) double-counted
  it and pushed the popup ~30pt too low; while the mac tray handle or
  status-item rect isn't available yet (async init), report
  WindowPosition.PlatformDefault so the visibleOnStart poll loop keeps
  polling instead of latching a screen-corner fallback
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