diff --git a/CHANGELOG.md b/CHANGELOG.md index 39ba7fc..73d845a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,11 @@ # Change Log ## [Unreleased] +### Changed +- MediaKeyTap switched a forked version to manually update kmbmpdc as the active listener application + +### Fixed +- Pressing any of the menubar buttons now properly sets kmbmpdc as the active listener ## [1.1.0] - 2017-01-29 ### Added diff --git a/Cartfile b/Cartfile index 8a652e9..1a74e9c 100644 --- a/Cartfile +++ b/Cartfile @@ -1 +1 @@ -github "nhurden/MediaKeyTap" +github "arttuperala/MediaKeyTap" "master" diff --git a/Cartfile.resolved b/Cartfile.resolved index dad2d18..b71bf36 100644 --- a/Cartfile.resolved +++ b/Cartfile.resolved @@ -1 +1 @@ -github "nhurden/MediaKeyTap" "1.0.0" +github "arttuperala/MediaKeyTap" "f5e37a6ba36e405145c69ef06b3c39cc668a8f97" diff --git a/README.md b/README.md index 6468e4c..fdeaf5a 100644 --- a/README.md +++ b/README.md @@ -48,7 +48,7 @@ The following priority is used for cover art images: * [imeji](https://github.com/arttuperala/imeji) * [libmpdclient](https://www.musicpd.org/libs/libmpdclient/) -* [MediaKeyTap](https://github.com/nhurden/MediaKeyTap) +* forked [MediaKeyTap](https://github.com/arttuperala/MediaKeyTap) #### Requirements diff --git a/kmbmpdc/Controls.swift b/kmbmpdc/Controls.swift index 0c44688..67c7a95 100644 --- a/kmbmpdc/Controls.swift +++ b/kmbmpdc/Controls.swift @@ -46,8 +46,7 @@ class Controls: NSViewController, MediaKeyTapDelegate { // active listener applications exit. mediaKeyTap = MediaKeyTap(delegate: self) mediaKeyTap?.start() - let notification = Notification(name: NSNotification.Name.NSWorkspaceDidActivateApplication) - NotificationCenter.default.post(notification) + mediaKeyTap?.activate() // Set the button images to templates to play nice with dark mode. playPauseButton.image?.isTemplate = true @@ -122,8 +121,7 @@ class Controls: NSViewController, MediaKeyTapDelegate { } @IBAction func menuWasClicked(_ sender: AnyObject) { - let notification = Notification(name: NSNotification.Name.NSWorkspaceDidActivateApplication) - NotificationCenter.default.post(notification) + mediaKeyTap?.activate() guard let delegate = appDelegate else { return @@ -134,8 +132,7 @@ class Controls: NSViewController, MediaKeyTapDelegate { } @IBAction func nextWasClicked(_ sender: AnyObject) { - let notification = Notification(name: NSNotification.Name.NSWorkspaceDidActivateApplication) - NotificationCenter.default.post(notification) + mediaKeyTap?.activate() if MPDController.sharedController.connected { MPDController.sharedController.next() @@ -154,8 +151,7 @@ class Controls: NSViewController, MediaKeyTapDelegate { } @IBAction func playPauseWasClicked(_ sender: AnyObject) { - let notification = Notification(name: NSNotification.Name.NSWorkspaceDidActivateApplication) - NotificationCenter.default.post(notification) + mediaKeyTap?.activate() if MPDController.sharedController.connected { MPDController.sharedController.playPause()