How lwouis/alt-tab-macos works
Main Components
• Application Logic Layer
• Windows Management (Windows.swift, Window.swift)
• Applications Management (Applications.swift, Application.swift)
• Spaces Management (Spaces.swift)
• UI Layer
• Main Window (ThumbnailsPanel.swift, PreviewPanel.swift)
• Preferences Window
• Permission Window
b. Event System (Left side):
• Event Handlers (Group these together)
• AccessibilityEvents
• KeyboardEvents
• MouseEvents
• SpacesEvents
• SystemEvents
• DockEvents
c. System Integration (Right side):
• API Wrappers
• AXUIElement (Accessibility)
• CGWindow
• MissionControl
• Private APIs
• Event flow from Event System to Core Components
• UI updates from Core Components to UI Layer
• System interaction between API Wrappers and macOS
External Dependencies (Bottom)
• AppCenter (Crash Reporting)
• Sparkle (Updates)
• SwiftyBeaver (Logging)
• ShortcutRecorder (Keyboard Shortcuts)
Component Relationships
• Use double lines for data binding
Specific Implementation Details
• A "Permissions" subsystem showing integration with macOS security
• Preferences system showing configuration flow
• Window thumbnail management pipeline
Notes for Implementation
• Event-driven nature of the application
• How accessibility APIs are leveraged
• Cross-space window management