Removed OSD lock popup completely (#791)

This commit is contained in:
Istvan Toth 2021-11-16 11:56:49 +01:00 committed by GitHub
parent ec83769e21
commit a2203ab2b1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 0 additions and 23 deletions

View file

@ -21,7 +21,6 @@ class MediaKeyTapManager: MediaKeyTapDelegate {
return
}
guard app.sleepID == 0, app.reconfigureID == 0 else {
self.showOSDLock(mediaKey)
return
}
if isPressed, self.handleOpenPrefPane(mediaKey: mediaKey, event: event, modifiers: modifiers) {
@ -68,15 +67,6 @@ class MediaKeyTapManager: MediaKeyTapDelegate {
}
}
private func showOSDLock(_ mediaKey: MediaKey) {
if [.brightnessUp, .brightnessDown].contains(mediaKey) {
OSDUtils.showOSDLockOnAllDisplays(osdImage: OSDUtils.OSDImage.brightness.rawValue)
}
if [.volumeUp, .volumeDown, .mute].contains(mediaKey) {
OSDUtils.showOSDLockOnAllDisplays(osdImage: OSDUtils.OSDImage.audioSpeaker.rawValue)
}
}
private func sendDisplayCommand(mediaKey: MediaKey, isRepeat: Bool, isSmallIncrement: Bool, isPressed: Bool, isContrast: Bool = false) {
self.sendDisplayCommandVolumeMute(mediaKey: mediaKey, isRepeat: isRepeat, isSmallIncrement: isSmallIncrement, isPressed: isPressed)
self.sendDisplayCommandBrightnessContrast(mediaKey: mediaKey, isRepeat: isRepeat, isSmallIncrement: isSmallIncrement, isPressed: isPressed, isContrast: isContrast)

View file

@ -74,17 +74,4 @@ class OSDUtils: NSObject {
static func getDistance(fromNearestChiclet chiclet: Float) -> Float {
abs(chiclet.rounded(.towardZero) - chiclet)
}
static func showOSDLockOnAllDisplays(osdImage: Int64) {
var displayCount: UInt32 = 0
var onlineDisplays = [CGDirectDisplayID](repeating: 0, count: Int(16))
if CGGetOnlineDisplayList(16, &onlineDisplays, &displayCount) == CGError.success {
let displayIDs = onlineDisplays.prefix(Int(displayCount))
for id in displayIDs {
if let manager = OSDManager.sharedManager() as? OSDManager {
manager.showImage(osdImage, onDisplayID: id, priority: 0x1F4, msecUntilFade: 1000, filledChiclets: 0, totalChiclets: 100, locked: true)
}
}
}
}
}