EPOD Window Bar is a macOS agent app. It shows a thin strip above the Dock with one tab per window of the frontmost application. One click raises the window. Build from source with XcodeGen and Xcode. Signing uses Config.xcconfig (ad-hoc by default; a local Local.xcconfig can set a team ID). The app needs Accessibility and Screen Recording permissions, and runs in a reduced mode without Screen Recording. See README.md and docs/ for details.
44 lines
1.6 KiB
Swift
44 lines
1.6 KiB
Swift
import AppKit
|
|
|
|
// StripPanel is the always-visible strip above the Dock. The panel does not
|
|
// take focus from the frontmost application. See spec section 7.7.
|
|
final class StripPanel: NSPanel {
|
|
|
|
init(contentRect: NSRect) {
|
|
super.init(contentRect: contentRect,
|
|
styleMask: [.borderless, .nonactivatingPanel],
|
|
backing: .buffered,
|
|
defer: false)
|
|
|
|
becomesKeyOnlyIfNeeded = true
|
|
hasShadow = false
|
|
hidesOnDeactivate = false
|
|
isReleasedWhenClosed = false
|
|
isFloatingPanel = true
|
|
isOpaque = false
|
|
backgroundColor = .clear
|
|
|
|
// The strip joins all Spaces. The strip does not move. The strip does
|
|
// not take part in the window cycle.
|
|
collectionBehavior = [.canJoinAllSpaces, .stationary, .ignoresCycle]
|
|
|
|
// The strip is above normal windows but below the Dock. The Dock
|
|
// magnification can then cover the strip.
|
|
level = NSWindow.Level(rawValue: Int(CGWindowLevelForKey(.dockWindow)) - 1)
|
|
|
|
// The background uses a visual effect view. The material is close to
|
|
// the Dock.
|
|
let effect = NSVisualEffectView(frame: NSRect(origin: .zero, size: contentRect.size))
|
|
effect.material = .hudWindow
|
|
effect.blendingMode = .behindWindow
|
|
effect.state = .active
|
|
effect.autoresizingMask = [.width, .height]
|
|
contentView = effect
|
|
}
|
|
|
|
// The panel must not become the key window. A click on the strip must not
|
|
// take focus from the frontmost application.
|
|
override var canBecomeKey: Bool { false }
|
|
override var canBecomeMain: Bool { false }
|
|
}
|