Skip to content

Commit

Permalink
v3 on video driver fix, high sierra focus fix
Browse files Browse the repository at this point in the history
  • Loading branch information
glouel committed Oct 30, 2018
1 parent 9b754ab commit 67a4dcb
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 10 deletions.
9 changes: 9 additions & 0 deletions Aerial/Source/Controllers/PreferencesWindowController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -493,6 +493,15 @@ class PreferencesWindowController: NSWindowController, NSOutlineViewDataSource,
@IBAction func close(_ sender: AnyObject?) {
logPanel.close()
window?.sheetParent?.endSheet(window!)
if #available(OSX 10.14, *) {
} else {
// Is there a better feeling than fixing a weird bug calling methods
// documented as "never invoke this method directly" ?
window?.resignMain()
window?.resignKey()
window?.becomeMain()
window?.becomeKey()
}
}

// MARK: Video playback
Expand Down
16 changes: 8 additions & 8 deletions Aerial/Source/Views/AerialView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -347,24 +347,24 @@ class AerialView: ScreenSaverView {
messageLayer.shadowColor = CGColor.black
//messageLayer.contentsScale = 1.0 // NSScreen.main?.backingScaleFactor ?? 1.0
layer.addSublayer(messageLayer)

if #available(OSX 10.14, *) {
} else {
debugLog("Using dot workaround for video driver corruption")
// Tentative fix for high sierra issues
let highSierraLayer = CATextLayer()
highSierraLayer.frame = self.bounds
highSierraLayer.opacity = 0.1
highSierraLayer.opacity = 0.5
highSierraLayer.font = NSFont(name: "Helvetica Neue Medium", size: 4)
highSierraLayer.fontSize = 4
highSierraLayer.string = "."
let attributes: [NSAttributedString.Key : Any] = [NSAttributedString.Key.font : highSierraLayer.font as Any]

let attributes: [NSAttributedString.Key: Any] = [NSAttributedString.Key.font: highSierraLayer.font as Any]

// Calculate bounding box
let s = NSAttributedString(string: highSierraLayer.string as! String, attributes: attributes)
let rect = s.boundingRect(with: layer.visibleRect.size, options: NSString.DrawingOptions.usesLineFragmentOrigin)
let attrString = NSAttributedString(string: highSierraLayer.string as! String, attributes: attributes)
let rect = attrString.boundingRect(with: layer.visibleRect.size, options: NSString.DrawingOptions.usesLineFragmentOrigin)

highSierraLayer.frame = rect
highSierraLayer.position = CGPoint(x: 2, y: 2)
highSierraLayer.anchorPoint = CGPoint(x: 0, y: 0)
Expand Down
4 changes: 2 additions & 2 deletions Resources/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@
<key>CFBundlePackageType</key>
<string>BNDL</string>
<key>CFBundleShortVersionString</key>
<string>1.4.5beta1</string>
<string>1.4.5beta2</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>1.4.5beta1</string>
<string>1.4.5beta2</string>
<key>LSApplicationCategoryType</key>
<string></string>
<key>LSMinimumSystemVersion</key>
Expand Down

0 comments on commit 67a4dcb

Please sign in to comment.