Rune comes from app/vendor/rune now, a checkout of 63ad0209 on branch ported, carrying the four commits of upstream issues 1320 (a pause while a clip is layered holds the layer's picture and time) and 1325 (a video's sound is read ahead of the clock and leads it). Both were written against eb9f1104 and ported across the refactors since. The faults are the first two and the third in docs/rune-upstream.md; the app's workarounds in review.rs stay until the fixes arrive upstream.
rune-mac
Small macOS helpers for Rune apps, with Rune's scripts/mac-app (see "Relaunching a Mac app"
in crates/rune/README.md), which relaunches a rebuilt app in place without its window
blinking or taking focus.
| Helper | What it does |
|---|---|
launch() |
Call first thing in main. When scripts/mac-app relaunched the app while it wasn't in front, it starts behind the app in front instead of taking focus. |
remember_frame(name) -> bool |
Has AppKit save the window frame under name and restore it next launch, so a rebuild's window lands over the old one. Call it from poll until it returns true. |
saved_size(name) -> Option<(f32, f32)> |
The size remember_frame(name) saved, to open the window at (AppSpec::size), so the layout doesn't animate to it at launch. |
toggle_full_screen(), is_full_screen() |
The key window's macOS full screen (the green button, ⌃⌘F). |
busy(on) |
Holds scripts/mac-app's relaunch while on, for work a relaunch would lose. |
notify |
rune-notify, re-exported: system notifications on macOS (UNUserNotificationCenter) and Windows (toasts). See its README. |
Off macOS every helper is a no-op: remember_frame returns true, saved_size returns None,
is_full_screen returns false, and the rest do nothing.
fn main() {
rune_mac::launch();
let size = rune_mac::saved_size("Example").unwrap_or((900.0, 640.0));
rune::run(AppSpec::<State> {
poll: Some(|s, _, _| {
if !s.framed { s.framed = rune_mac::remember_frame("Example") }
false
}),
..AppSpec::new("Example", size, State::default, view)
});
}