diff --git a/Package.resolved b/Package.resolved index 4c049e5..3961025 100644 --- a/Package.resolved +++ b/Package.resolved @@ -14,9 +14,9 @@ "package": "swift-ddc", "repositoryURL": "https://github.com/aleksey-mashanov/swift-ddc.git", "state": { - "branch": "master", - "revision": "40d9ac39e9204727b983637af1bfa7c46d4beef6", - "version": null + "branch": null, + "revision": "4c4e1487515d5cfcea55470eb44be59a27a11a25", + "version": "1.0.0" } } ] diff --git a/Package.swift b/Package.swift index ec72470..4e5764b 100644 --- a/Package.swift +++ b/Package.swift @@ -8,7 +8,7 @@ let package = Package( .macOS(.v10_13), ], dependencies: [ - .package(url: "https://github.com/aleksey-mashanov/swift-ddc.git", .branch("master")), + .package(url: "https://github.com/aleksey-mashanov/swift-ddc.git", from: "1.0.0"), .package(url: "https://github.com/apple/swift-argument-parser.git", .upToNextMinor(from: "0.3.0")), ], targets: [ diff --git a/Sources/brisyncd/target.swift b/Sources/brisyncd/target.swift index 8a5b82e..258f3b2 100644 --- a/Sources/brisyncd/target.swift +++ b/Sources/brisyncd/target.swift @@ -52,7 +52,6 @@ class TargetDisplays: PublishTerminateHandler { class TargetDisplay: Display { let display: io_service_t - let framebuffer: io_service_t let ddc: DDC var brightness: UInt16 = 101 var contrast: UInt16 = 101 @@ -60,14 +59,8 @@ class TargetDisplay: Display { var job = Job() init?(_ display: io_service_t) { - guard let framebuffer = Self.framebuffer(forDisplay: display) else { - IOObjectRelease(display) - return nil - } self.display = display - self.framebuffer = framebuffer - guard let ddc = try? DDC(framebuffer: framebuffer) else { - IOObjectRelease(framebuffer) + guard let ddc = try? DDC(display: display) else { IOObjectRelease(display) return nil } @@ -75,7 +68,6 @@ class TargetDisplay: Display { } deinit { - IOObjectRelease(framebuffer) IOObjectRelease(display) } @@ -179,17 +171,4 @@ class TargetDisplay: Display { } } } - - static func framebuffer(forDisplay display: io_service_t) -> io_service_t? { - var displayConnect: io_service_t = 0 - guard IORegistryEntryGetParentEntry(display, kIOServicePlane, &displayConnect) == KERN_SUCCESS else { - return nil - } - defer { IOObjectRelease(displayConnect) } - var framebuffer: io_service_t = 0 - guard IORegistryEntryGetParentEntry(displayConnect, kIOServicePlane, &framebuffer) == KERN_SUCCESS else { - return nil - } - return framebuffer - } }