Mission Control Turbo: macOS multitasking turbocharged
at main 26 lines 685 B view raw
1import AppKit 2import CoreGraphics 3 4/// Represents a single on-screen window with its metadata and thumbnail. 5struct WindowInfo: Identifiable, Equatable { 6 let windowID: CGWindowID 7 let title: String 8 let appName: String 9 let appBundleID: String 10 let appIcon: NSImage? 11 let frame: CGRect 12 let pid: pid_t 13 let isOnScreen: Bool 14 var thumbnail: CGImage? 15 16 var id: CGWindowID { windowID } 17 18 /// Fingerprint component for layout stability. 19 var fingerprintKey: String { 20 "\(appBundleID)|\(title)" 21 } 22 23 static func == (lhs: WindowInfo, rhs: WindowInfo) -> Bool { 24 lhs.windowID == rhs.windowID && lhs.thumbnail === rhs.thumbnail 25 } 26}