Skip to content

Commit c5997ed

Browse files
committed
Fix hideDisplayOsd.
1 parent ec683fa commit c5997ed

1 file changed

Lines changed: 5 additions & 4 deletions

File tree

MonitorControl/Display.swift

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,9 @@ class Display {
2727
return
2828
}
2929

30-
_ = self.ddc?.write(command: .osd, value: UInt16(1))
31-
_ = self.ddc?.write(command: .osd, value: UInt16(1))
30+
for _ in 0..<20 {
31+
_ = self.ddc?.write(command: .osd, value: UInt16(1), errorRecoveryWaitTime: 2000)
32+
}
3233
}
3334

3435
func mute() {
@@ -41,7 +42,7 @@ class Display {
4142
}
4243

4344
DispatchQueue.global(qos: .userInitiated).async {
44-
guard self.ddc?.write(command: .audioSpeakerVolume, value: UInt16(value)) == true else {
45+
guard self.ddc?.write(command: .audioSpeakerVolume, value: UInt16(value), errorRecoveryWaitTime: self.hideOsd ? 0 : nil) == true else {
4546
return
4647
}
4748

@@ -60,7 +61,7 @@ class Display {
6061
}
6162

6263
DispatchQueue.global(qos: .userInitiated).async {
63-
guard self.ddc?.write(command: .audioSpeakerVolume, value: UInt16(value)) == true else {
64+
guard self.ddc?.write(command: .audioSpeakerVolume, value: UInt16(value), errorRecoveryWaitTime: self.hideOsd ? 0 : nil) == true else {
6465
return
6566
}
6667

0 commit comments

Comments
 (0)