import AppKit // A non-activating panel: clicking it (e.g. a workspace cell) runs the action // without stealing focus from the app you're working in. final class BarWindow: NSPanel { init(contentRect: NSRect) { super.init( contentRect: contentRect, styleMask: [.nonactivatingPanel, .borderless], backing: .buffered, defer: false ) animationBehavior = .none backgroundColor = .clear becomesKeyOnlyIfNeeded = true collectionBehavior = [ .canJoinAllSpaces, .fullScreenAuxiliary, .fullScreenNone, .stationary, ] hasShadow = false hidesOnDeactivate = false isFloatingPanel = true isMovable = false isOpaque = false isReleasedWhenClosed = false level = .floating } override var canBecomeMain: Bool { false } override var canBecomeKey: Bool { true } }