Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Platform Differences

Behavior differences across Windows, macOS, and Linux.

Window Management

Title Bar

FeatureWindowsmacOSLinux
Custom title barSupportedLimitedVaries by WM
Traffic lights positionN/ALeftN/A
Menu in title barSupportedSystem menu barSupported

Window Decorations

  • Windows: Standard Win32 decorations
  • macOS: Native NSWindow decorations
  • Linux: Depends on window manager (X11/Wayland)

Styling

System Colors

Use SystemTheme::accent_color() for the platform accent color.

PlatformAccent Color Source
WindowsWinRT UISettings
macOSNSColor.controlAccentColor
LinuxXDG Portal (if available)

Dark Mode

Use SystemTheme::color_scheme() to detect light/dark mode.

PlatformDetection Method
WindowsAppsUseLightTheme registry
macOSNSApp.effectiveAppearance
LinuxXDG Portal color-scheme

Text Rendering

Font Selection

System fonts vary by platform:

  • Windows: Segoe UI
  • macOS: SF Pro / San Francisco
  • Linux: System dependent (often DejaVu)

Font Rendering

FeatureWindowsmacOSLinux
Subpixel AAClearTypeNativeFreeType
Font hintingStrongNoneConfigurable

Input

Keyboard

FeatureWindowsmacOSLinux
Command keyCtrlCmdCtrl
Context menuApplication keyCtrl+ClickApplication key
IMETSFInput SourcesIBus/Fcitx

Touch

FeatureWindowsmacOSLinux
Touch eventsNativeNativeVia libinput
GesturesWM_GESTURENSEventLimited

File System

Path Conventions

PlatformConfig DirData Dir
Windows%APPDATA%%LOCALAPPDATA%
macOS~/Library/Application SupportSame
Linux~/.config~/.local/share

Use platform::directories() for cross-platform paths.

Known Limitations

Linux

  • High contrast detection not fully implemented
  • Some advanced clipboard formats not supported on Wayland
  • Native file dialogs depend on portal availability

macOS

  • Custom title bar colors limited
  • Some animations may differ from system style

Windows

  • DPI scaling may require manifest for older apps
  • Per-monitor DPI awareness needs explicit opt-in

Graphics Backend

Renderer Selection

PlatformPrimary BackendFallback
WindowsDirect3D 12Vulkan, Direct3D 11
macOSMetal-
LinuxVulkanOpenGL

Performance Considerations

use horizon_lattice::render::GraphicsConfig;

// Force specific backend
let config = GraphicsConfig::new()
    .with_preferred_backend(Backend::Vulkan);

Clipboard

Supported Formats

FormatWindowsmacOSLinux
TextFullFullFull
HTMLFullFullPartial
ImagesFullFullX11 only
FilesFullFullWayland limited

Async Clipboard (Wayland)

On Wayland, clipboard operations may be asynchronous:

use horizon_lattice::clipboard::Clipboard;

// Prefer async API on Wayland
Clipboard::get_text_async(|text| {
    if let Some(t) = text {
        println!("Got: {}", t);
    }
});

Drag and Drop

FeatureWindowsmacOSLinux
File dropsFullFullFull
Custom dataFullFullPartial
Drag imagesFullFullX11 only

Window Behavior

Fullscreen

// Native fullscreen (best integration)
window.set_fullscreen(FullscreenMode::Native);

// Borderless fullscreen (consistent across platforms)
window.set_fullscreen(FullscreenMode::Borderless);
ModeWindowsmacOSLinux
NativeWin32NSWindowWM dependent
BorderlessConsistentConsistentConsistent

Always on Top

window.set_always_on_top(true);

Works consistently across all platforms.

Transparency

window.set_transparent(true);
window.set_opacity(0.9);
FeatureWindowsmacOSLinux
Window opacityFullFullCompositor dependent
Transparent regionsFullFullCompositor dependent

Dialogs

Native Dialogs

DialogWindowsmacOSLinux
File Open/SaveIFileDialogNSOpenPanelPortal/GTK
Color PickerChooseColorNSColorPanelPortal/GTK
Font PickerChooseFontNSFontPanelPortal/GTK
Message BoxMessageBoxNSAlertPortal/GTK

Linux Portal Integration

On Linux, Horizon Lattice uses XDG Desktop Portal when available:

use horizon_lattice::platform::linux;

// Check if portals are available
if linux::portals_available() {
    // Native dialogs will use portals
} else {
    // Falls back to GTK dialogs
}

Keyboard Shortcuts

Modifier Key Mapping

ActionWindows/LinuxmacOS
CopyCtrl+CCmd+C
PasteCtrl+VCmd+V
CutCtrl+XCmd+X
UndoCtrl+ZCmd+Z
RedoCtrl+YCmd+Shift+Z
Select AllCtrl+ACmd+A
SaveCtrl+SCmd+S
FindCtrl+FCmd+F
Close WindowAlt+F4Cmd+W
QuitAlt+F4Cmd+Q

Horizon Lattice automatically maps shortcuts appropriately per platform.

Accessibility

Screen Readers

PlatformSupported API
WindowsUI Automation
macOSNSAccessibility
LinuxAT-SPI2

High Contrast

use horizon_lattice::platform::SystemTheme;

if SystemTheme::is_high_contrast() {
    // Adjust colors for visibility
}
PlatformDetection
WindowsSystemParametersInfo
macOSNSWorkspace
LinuxPortal (partial)

Locale and Text

Input Methods

PlatformIME Framework
WindowsTSF (Text Services Framework)
macOSInput Sources
LinuxIBus, Fcitx, XIM

Right-to-Left Text

Full RTL support on all platforms. Use TextDirection::Auto for automatic detection:

use horizon_lattice::text::TextDirection;

label.set_text_direction(TextDirection::Auto);