Skip to content

Improve native macOS menu bar, Dock menu, and About window integration - #68

Merged
Marc-André Moreau (mamoreau-devolutions) merged 2 commits into
masterfrom
macos-native-menus
Nov 12, 2026
Merged

Marc-André Moreau (mamoreau-devolutions) merged 2 commits into
masterfrom
macos-native-menus

Conversation

@mamoreau-devolutions

Copy link
Copy Markdown
Contributor

Summary

Brings consistent, native macOS menu integration across Devolutions Terminal strictly using Avalonia APIs (NativeMenu, NativeDock, ContextMenu, and IClassicDesktopStyleApplicationLifetime):

  • Application menu & About window (App.axaml, App.axaml.cs, AboutWindow.cs):
    • Sets Application.Name = "Devolutions Terminal" and attaches the application NativeMenu inside Application.Initialize() (before AppBuilder.AfterSetup runs SetupApplicationMenuExporter) so Avalonia does not fall back to its generic "About Avalonia" menu item and dialog.
    • Preserves Avalonia's built-in standard macOS menu items (Services, Hide Devolutions Terminal, Hide Others, Show All, and Quit) while coordinating Quit (⌘Q / Dock Quit) with MainWindow.RequestApplicationCloseAsync via desktop.ShutdownRequested.
    • Adds a dedicated standalone AboutWindow on macOS with Devolutions Terminal branding, version info, project links, and copyright.
  • Dynamic Window & Dock menus (MacOsNativeMenu.cs, MainWindow.axaml.cs, TerminalWindowRouter.cs):
    • Adds a NativeDock right-click menu listing open terminal windows, New Window, New Window With Profile, and New Tab.
    • Expands window NativeMenus (File, Edit, View, Window, Help) with live NeedsUpdate state synchronization (profiles submenu, split/close pane vs. tab state, text-box/editor Undo/Redo/Cut/Copy/Paste/Select All routing, marks, font zoom, full-screen/focus toggles, and open tabs list), plus secondary window menus (⌘W, Edit, Window).
  • Iseberg menu bar (PowerShellIseTab.cs, WorkbenchControl.Hosting.cs):
    • Hides the in-window <Menu> bar on macOS and mirrors Iseberg's File, Edit, View, Tools, Debug, Add-ons, and Help menus into the native macOS menu bar.
  • Context menus (TermControl.cs, MainWindow.axaml.cs, SettingsLoader.cs):
    • Defaults rightClickContextMenu to true on macOS (supporting both right-click and Control-click) with terminal/hyperlink/tab context menus, and renders vector Path icons where Windows-only Segoe Fluent Icons glyphs are unavailable.

Testing

  • Added unit and headless UI tests in MacOsNativeMenuTests, WindowActionRegistrationTests, and SettingsParityTests.
  • Built Devolutions.Terminal.slnx (with and without EnablePowerShellIse) with zero warnings/errors and verified live macOS menu bar, Dock menu, and About window behavior.

- Attach the macOS application NativeMenu during Application.Initialize() (alongside Application.Name) before Avalonia's SetupApplicationMenuExporter runs so DT's menu replaces the fallback 'About Avalonia' item, while keeping Avalonia's standard Services, Hide, Hide Others, Show All, and Quit items coordinated through ShutdownRequested.
- Add a standalone macOS AboutWindow with Devolutions Terminal branding, version info, and project links.
- Add dynamic NativeDock menu support and comprehensive state-aware Window NativeMenus (File, Edit, View, Window, Help, plus secondary windows).
- Hide Iseberg's in-window menu bar on macOS and mirror File/Edit/View/Tools/Debug/Add-ons/Help into the native menu bar.
- Enable terminal right-click/Control-click context menus by default on macOS and render vector icons where Windows Fluent font glyphs are unavailable.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Stop the listener and drain in-flight upgraded WebSocket handlers before closing HttpListener, and ignore ObjectDisposedException/HttpListenerException when managed HttpListener flushes already-disposed upgraded NetworkStreams.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

This branch was successfully deployed

1 active deployment
publish-dry-run — 2eed1b21 Deployed Nov 12, 2026 by mamoreau-devolutions via MSI packages #405
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