EPOD Window Bar: a window strip above the macOS Dock
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.
This commit is contained in:
43
Sources/Strip/StripPanel.swift
Normal file
43
Sources/Strip/StripPanel.swift
Normal file
@@ -0,0 +1,43 @@
|
||||
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 }
|
||||
}
|
||||
Reference in New Issue
Block a user