From 674b30e3bb5e0be319aaf835a4d0fcc5d0ebb1f6 Mon Sep 17 00:00:00 2001 From: Guillaume Louel Date: Thu, 11 Apr 2019 17:15:25 +0200 Subject: [PATCH] de/he support Enabled . workaround for crashy video drivers on Mojave, as the latest 10.14.5 beta is acting up again ! --- Aerial.xcodeproj/project.pbxproj | 13 ++++++ .../Models/Cache/PoiStringProvider.swift | 2 +- Aerial/Source/Views/AerialView.swift | 40 +++++++++---------- Resources/Info.plist | 4 +- 4 files changed, 36 insertions(+), 23 deletions(-) diff --git a/Aerial.xcodeproj/project.pbxproj b/Aerial.xcodeproj/project.pbxproj index 3014e0c0..7dc73435 100644 --- a/Aerial.xcodeproj/project.pbxproj +++ b/Aerial.xcodeproj/project.pbxproj @@ -25,6 +25,10 @@ 03510C7121834FC7008F74F2 /* IOBridge.m in Sources */ = {isa = PBXBuildFile; fileRef = 03510C6E21834F38008F74F2 /* IOBridge.m */; }; 03510C732185EF76008F74F2 /* CoreLocation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 03510C722185EF76008F74F2 /* CoreLocation.framework */; }; 03510C772185EF8F008F74F2 /* CoreLocation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 03510C722185EF76008F74F2 /* CoreLocation.framework */; }; + 035A92A6225F8C480095AB85 /* de.json in Resources */ = {isa = PBXBuildFile; fileRef = 035A92A4225F8C480095AB85 /* de.json */; }; + 035A92A7225F8C480095AB85 /* de.json in Resources */ = {isa = PBXBuildFile; fileRef = 035A92A4225F8C480095AB85 /* de.json */; }; + 035A92A8225F8C480095AB85 /* he.json in Resources */ = {isa = PBXBuildFile; fileRef = 035A92A5225F8C480095AB85 /* he.json */; }; + 035A92A9225F8C480095AB85 /* he.json in Resources */ = {isa = PBXBuildFile; fileRef = 035A92A5225F8C480095AB85 /* he.json */; }; 0369985D2196103300E359D3 /* missingvideos.json in Resources */ = {isa = PBXBuildFile; fileRef = 0369985C2196103300E359D3 /* missingvideos.json */; }; 0369985E2196129C00E359D3 /* missingvideos.json in Resources */ = {isa = PBXBuildFile; fileRef = 0369985C2196103300E359D3 /* missingvideos.json */; }; 03893CB3217749F0008E7125 /* ErrorLog.swift in Sources */ = {isa = PBXBuildFile; fileRef = 03893CB2217749F0008E7125 /* ErrorLog.swift */; }; @@ -108,6 +112,8 @@ 03510C6D21834F38008F74F2 /* Aerial-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Aerial-Bridging-Header.h"; sourceTree = ""; }; 03510C6E21834F38008F74F2 /* IOBridge.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = IOBridge.m; sourceTree = ""; }; 03510C722185EF76008F74F2 /* CoreLocation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreLocation.framework; path = System/Library/Frameworks/CoreLocation.framework; sourceTree = SDKROOT; }; + 035A92A4225F8C480095AB85 /* de.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = de.json; sourceTree = ""; }; + 035A92A5225F8C480095AB85 /* he.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = he.json; sourceTree = ""; }; 0369985C2196103300E359D3 /* missingvideos.json */ = {isa = PBXFileReference; lastKnownFileType = text.json; path = missingvideos.json; sourceTree = ""; }; 03893CB2217749F0008E7125 /* ErrorLog.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ErrorLog.swift; sourceTree = ""; }; 039385792175D4B80040B850 /* AVPlayerViewExtension.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AVPlayerViewExtension.swift; sourceTree = ""; }; @@ -193,6 +199,8 @@ 033192DF217B77E90073B580 /* Community */ = { isa = PBXGroup; children = ( + 035A92A4225F8C480095AB85 /* de.json */, + 035A92A5225F8C480095AB85 /* he.json */, 03D3DAC3221F286700BDA52F /* pl.json */, 03D37FD722145487005A146F /* es.json */, 03D37FD822145487005A146F /* fr.json */, @@ -490,6 +498,7 @@ developmentRegion = English; hasScannedForEncodings = 0; knownRegions = ( + English, en, Base, ); @@ -522,6 +531,8 @@ 033D62AC216CADCD00F3AF83 /* icon-day-dark.pdf in Resources */, FAC36F4A1BE1756D007F2A20 /* MainMenu.xib in Resources */, FAC36F501BE1756D007F2A20 /* icon-night.pdf in Resources */, + 035A92A9225F8C480095AB85 /* he.json in Resources */, + 035A92A7225F8C480095AB85 /* de.json in Resources */, 0395835421807D1F008E8F9C /* thumbnail@2x.png in Resources */, 03D37FDC22145487005A146F /* fr.json in Resources */, ); @@ -541,8 +552,10 @@ buildActionMask = 2147483647; files = ( FAC36F531BE1756D007F2A20 /* PreferencesWindow.xib in Resources */, + 035A92A6225F8C480095AB85 /* de.json in Resources */, 03D37FDB22145487005A146F /* fr.json in Resources */, FAC36F4D1BE1756D007F2A20 /* icon-day.pdf in Resources */, + 035A92A8225F8C480095AB85 /* he.json in Resources */, 03D3DAC4221F286700BDA52F /* pl.json in Resources */, 033D62AB216CADCD00F3AF83 /* icon-day-dark.pdf in Resources */, 0395835321807D1F008E8F9C /* thumbnail@2x.png in Resources */, diff --git a/Aerial/Source/Models/Cache/PoiStringProvider.swift b/Aerial/Source/Models/Cache/PoiStringProvider.swift index d1a29e1a..9a77c1d9 100644 --- a/Aerial/Source/Models/Cache/PoiStringProvider.swift +++ b/Aerial/Source/Models/Cache/PoiStringProvider.swift @@ -163,7 +163,7 @@ final class PoiStringProvider { let cc = locale.languageCode // Just in case, cause we had a crash earlier with the fr one for some reason... // This is probably no longer needed - if cc == "en" || cc == "es" || cc == "fr" || cc == "pl" { + if cc == "en" || cc == "es" || cc == "fr" || cc == "pl" || cc == "de" || cc == "he" { if preferences.localizeDescriptions { let path = Bundle(for: PoiStringProvider.self).path(forResource: cc, ofType: "json") if path != nil { diff --git a/Aerial/Source/Views/AerialView.swift b/Aerial/Source/Views/AerialView.swift index 1f10508f..6990281c 100644 --- a/Aerial/Source/Views/AerialView.swift +++ b/Aerial/Source/Views/AerialView.swift @@ -373,28 +373,28 @@ final class AerialView: ScreenSaverView { messageLayer.shadowColor = CGColor.black 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.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] + //if #available(OSX 10.14, *) { + //} else { + // This bug is back in 10.14.5 beta, so enabling the workaround all the time now. + debugLog("Using dot workaround for video driver corruption") + // Tentative fix for high sierra issues + let highSierraLayer = CATextLayer() + highSierraLayer.frame = self.bounds + 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] - // Calculate bounding box - let attrString = NSAttributedString(string: highSierraLayer.string as! String, attributes: attributes) - let rect = attrString.boundingRect(with: layer.visibleRect.size, options: NSString.DrawingOptions.usesLineFragmentOrigin) + // Calculate bounding box + 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) - layer.addSublayer(highSierraLayer) - } + highSierraLayer.frame = rect + highSierraLayer.position = CGPoint(x: 2, y: 2) + highSierraLayer.anchorPoint = CGPoint(x: 0, y: 0) + layer.addSublayer(highSierraLayer) } // MARK: - Lifecycle stuff diff --git a/Resources/Info.plist b/Resources/Info.plist index af3e7803..8a581bf1 100644 --- a/Resources/Info.plist +++ b/Resources/Info.plist @@ -15,11 +15,11 @@ CFBundlePackageType BNDL CFBundleShortVersionString - 1.4.7beta6 + 1.4.7beta7 CFBundleSignature ???? CFBundleVersion - 1.4.7beta6 + 1.4.7beta7 LSApplicationCategoryType LSMinimumSystemVersion