Skip to content

Add a desktop shell capability, tray icons and hidden mounts - #16

Merged
Marc-André Moreau (mamoreau-devolutions) merged 2 commits into
masterfrom
jiffshot-host-features
Oct 29, 2026
Merged

Marc-André Moreau (mamoreau-devolutions) merged 2 commits into
masterfrom
jiffshot-host-features

Conversation

@mamoreau-devolutions

Copy link
Copy Markdown
Contributor

Jiffshot (a screen capture tool and editor) now runs as one Rustolonia app: a tray icon, windows created hidden and shown later, topmost and see-through capture UI, and windows left out of screen captures. This adds what the projection did not cover yet.

What's in it

  • IAvnApplication6 (stage 33), a separately versioned capability. Existing hosts and consumers are unaffected:
    • SetShutdownMode: last window, main window or explicit (Run uses it).
    • CreateRustVmTray: tray icons are released when Run ends.
    • GetPlatformHandle, SetWindowTopmost, SetWindowTransparent.
    • SetWindowExcludedFromCapture: Windows only, E_NOTIMPL elsewhere.
  • Tray icons declared in the view-model schema:
    • A top-level trays list: model, a Tray-kind menu, icon, tooltip, activate command.
    • The Tray menu kind rejects gestures; Recent Files and toggles work as in application menus.
    • Generated Create{Menu} and Attach{Tray}Tray, plus RustViewRegistry.CreateTray.
    • The managed RustTrayAttachment, and a generated Rust mount_<tray>.
  • Hidden mounts:
    • AppScope::mount_hidden.
    • mount_dynamic_view_model_hidden, which returns the Window.
    • Generated mount_<view>_hidden, and Window::show.
  • Rust: rustolonia::shell (ShutdownMode, set_shutdown_mode, platform_handle, set_topmost, set_transparent, set_excluded_from_capture) over the rustolonia-sys vtable.
  • Docs: rust/COMPATIBILITY.md, rust/MENUS.md.

The schema gains trays only when one is declared, so existing IR files normalize unchanged. The sample and app outputs are regenerated: each registry gains an empty CreateTray, and nothing else changes.

Testing

  • Before the rebase:
    • tests/Avalonia.Projection.Ir.Tests: 138 passed, including the new ViewModelTrayIrTests.
    • tests/Avalonia.Projection.Generator.Tests: 98 passed, including the new ViewModelTrayEmitterTests.
    • rustolonia-sys nativeaot_fixture: 11 passed, including the new capability.
  • After rebasing onto master (which only adds the 12.1.1 host checksums): the IR and generator suites pass again. The native fixture was not rerun.
  • In use: Jiffshot has run on this branch through its whole move to one process. That covers the tray icon and its menu, the hidden editor and Capture windows, the explicit shutdown, and the platform handle.

Notes for review

  • This adds a new host capability, so per rust/COMPATIBILITY.md it belongs in a release that bumps all three crates. No version is bumped here.
  • Jiffshot builds these from source today. It needs a published release before it can use the prebuilt host.

🤖 Generated with Claude Code

A tray or capture tool needs what the projection did not cover yet:

- IAvnApplication6 (stage 33), a separately versioned capability:
  SetShutdownMode (last window, main window, explicit), CreateRustVmTray,
  GetPlatformHandle, SetWindowTopmost, SetWindowTransparent and
  SetWindowExcludedFromCapture (Windows only). Run uses the requested
  shutdown mode; trays are released when Run ends.
- Tray icons declared in the view-model schema: a top-level "trays"
  list (model, a Tray-kind menu, icon, tooltip, activate command), the
  Tray menu kind (gestures rejected), generated Create{Menu} and
  Attach{Tray}Tray methods, RustViewRegistry.CreateTray, the managed
  RustTrayAttachment, and a generated Rust mount_<tray>.
- Hidden mounts: AppScope::mount_hidden,
  mount_dynamic_view_model_hidden (returning the Window), generated
  mount_<view>_hidden, and Window::show.
- Rust: rustolonia::shell (ShutdownMode, set_shutdown_mode,
  platform_handle, set_topmost, set_transparent,
  set_excluded_from_capture) over the rustolonia-sys vtable.

The schema only gains "trays" when one is declared, so existing IR
files normalize unchanged; the sample and app outputs are regenerated
(each registry gains an empty CreateTray). IR and generator tests cover
trays; a native fixture test covers the new capability.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The 12.1.1 version bump refreshed rust/Cargo.lock only. The apps under
apps/ use rustolonia and rustolonia-sys by path with their own lock
files, which still named 12.1.0 (or 0.1.0), so CI's
`cargo test --locked` for the system monitor failed on master as well.
Their two entries are updated, and prepare-release.ps1 now updates
those entries in every app's lock file with each version bump.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@mamoreau-devolutions
Marc-André Moreau (mamoreau-devolutions) merged commit 5a80ef2 into master Oct 29, 2026
10 checks passed
@mamoreau-devolutions
Marc-André Moreau (mamoreau-devolutions) deleted the jiffshot-host-features branch October 29, 2026 20:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant