mirror of
https://github.com/MonitorControl/MonitorControl.git
synced 2026-05-16 14:15:55 -06:00
Removed OSD lock popup completely (#791)
This commit is contained in:
parent
ec83769e21
commit
a2203ab2b1
2 changed files with 0 additions and 23 deletions
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue