1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
//! macOS shell runner: `run_with_shell()` wraps a [`ShellApp`] in an
//! AppShell and drives it through the standard macOS (AppKit) event loop.
//!
//! The shared [`crate::shell_adapter::ShellAdapter`] owns all runtime logic
//! (bottom-panel init, panel routing, resize recalc, click dispatch), and
//! [`crate::shell_adapter::build_shell_adapter`] owns assembling one from a
//! [`ShellConfig`]. This module only wires the adapter into the macOS event
//! loop, mirroring `tui::shell_runner` / `gtk::shell_runner`.
//!
//! `MacBackend` already implements every `Backend` trait method `AppShell`
//! renders through (`draw_activity_bar`, `draw_sidebar_panel`,
//! `draw_tab_bar`, `draw_panel`, `draw_status_bar`, …), so no new rasteriser
//! work is needed here — this is pure composition, same as the TUI/GTK
//! runners.
//!
//! `config.title` reaches the runner via [`super::run::RunConfig`], mirroring
//! `gtk::shell_runner::run_with_shell` / `win::shell_runner::run_with_shell`.
//!
//! [`ShellConfig::client_side_titlebar`] reaches the runner the same
//! way — copied onto [`RunConfig`] before this module's `config` is moved
//! into [`build_shell_adapter`], since `RunConfig` (not `ShellConfig`) is
//! what [`super::run::run_with`]'s window-creation call site actually
//! consults.
use RunConfig;
use crate;
use cratebuild_shell_adapter;
/// Run a [`ShellApp`] with AppShell chrome on the macOS backend.
///
/// `config.app_icon` (set via [`ShellConfig::with_app_icon`])
/// reaches [`RunConfig::app_icon`] the same way `config.title` /
/// `config.client_side_titlebar` do — cloned out before `config` moves
/// into [`build_shell_adapter`], since `RunConfig` (not `ShellConfig`)
/// is what [`super::run::run_with`]'s AppKit-bootstrap call site
/// actually consults.
///
/// **Must be called from the main thread** — enforced transitively by
/// [`super::run::run_with`].