Skip to content

Commit

Permalink
Merge branch 'release/0.7.3' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
mangerlahn committed Feb 3, 2021
2 parents ca0db8e + 1e008ed commit 1ad4ad7
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 19 deletions.
4 changes: 2 additions & 2 deletions Latest.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -1188,7 +1188,7 @@
INFOPLIST_FILE = "$(SRCROOT)/Latest/Resources/Info.plist";
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/Frameworks";
MACOSX_DEPLOYMENT_TARGET = 10.13;
MARKETING_VERSION = 0.7.2;
MARKETING_VERSION = 0.7.3;
PRODUCT_BUNDLE_IDENTIFIER = "com.max-langer.Latest";
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
Expand Down Expand Up @@ -1219,7 +1219,7 @@
INFOPLIST_FILE = "$(SRCROOT)/Latest/Resources/Info.plist";
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/Frameworks";
MACOSX_DEPLOYMENT_TARGET = 10.13;
MARKETING_VERSION = 0.7.2;
MARKETING_VERSION = 0.7.3;
PRODUCT_BUNDLE_IDENTIFIER = "com.max-langer.Latest";
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
Expand Down
6 changes: 3 additions & 3 deletions Latest/Interface/Base.lproj/Main.storyboard
Original file line number Diff line number Diff line change
Expand Up @@ -419,7 +419,7 @@
<window key="window" identifier="MainWindow" title="Latest" subtitle="3 Updates Found" allowsToolTipsWhenApplicationIsInactive="NO" autorecalculatesKeyViewLoop="NO" releasedWhenClosed="NO" frameAutosaveName="MainWindowSize" animationBehavior="default" titlebarAppearsTransparent="YES" id="IQv-IB-iLA">
<windowStyleMask key="styleMask" titled="YES" closable="YES" miniaturizable="YES" resizable="YES" fullSizeContentView="YES"/>
<rect key="contentRect" x="549" y="334" width="1004" height="495"/>
<rect key="screenRect" x="0.0" y="0.0" width="2560" height="1440"/>
<rect key="screenRect" x="0.0" y="0.0" width="2560" height="1415"/>
<value key="minSize" type="size" width="350" height="300"/>
<toolbar key="toolbar" implicitIdentifier="DF48FE56-E2C5-4C10-9902-E95C4C7EE57B" autosavesConfiguration="NO" allowsUserCustomization="NO" showsBaselineSeparator="NO" displayMode="iconOnly" sizeMode="regular" id="lw0-Zu-kOT">
<allowedToolbarItems>
Expand Down Expand Up @@ -935,7 +935,7 @@
<rect key="frame" x="462" y="0.0" width="66" height="96"/>
<subviews>
<button wantsLayer="YES" horizontalHuggingPriority="1000" verticalHuggingPriority="1000" horizontalCompressionResistancePriority="1000" verticalCompressionResistancePriority="1000" translatesAutoresizingMaskIntoConstraints="NO" id="n5Y-7Z-cEd" customClass="UpdateButton" customModule="Latest" customModuleProvider="target">
<rect key="frame" x="-7" y="44" width="80" height="32"/>
<rect key="frame" x="-7" y="43" width="80" height="32"/>
<buttonCell key="cell" type="push" title="Update" bezelStyle="rounded" alignment="center" borderStyle="border" imageScaling="proportionallyDown" inset="2" id="QRR-k0-TZ4" customClass="UpdateButtonCell" customModule="Latest" customModuleProvider="target">
<behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
<font key="font" metaFont="system"/>
Expand All @@ -952,7 +952,7 @@
</customView>
</subviews>
<constraints>
<constraint firstItem="i3z-7y-cNC" firstAttribute="firstBaseline" secondItem="n5Y-7Z-cEd" secondAttribute="firstBaseline" id="fV4-tG-PJ0"/>
<constraint firstItem="i3z-7y-cNC" firstAttribute="top" secondItem="n5Y-7Z-cEd" secondAttribute="top" id="fV4-tG-PJ0"/>
</constraints>
<visibilityPriorities>
<integer value="1000"/>
Expand Down
26 changes: 12 additions & 14 deletions Latest/Interface/Utilities/DisplayLink.swift
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ class DisplayLink: NSObject {
private(set) var progress : Double = 0

#if os(macOS)
private var displayLink : CVDisplayLink?
private var displayLink : CVDisplayLink!
#else
private var displayLink : CADisplayLink?
private var displayLink : CADisplayLink!
#endif

/// Frames used to calculate the animation progress
Expand Down Expand Up @@ -51,16 +51,19 @@ class DisplayLink: NSObject {
}

CVDisplayLinkCreateWithActiveCGDisplays(&self.displayLink)
CVDisplayLinkSetOutputCallback(self.displayLink!, displayLinkOutputCallback, UnsafeMutableRawPointer(Unmanaged.passUnretained(self).toOpaque()))
CVDisplayLinkSetOutputCallback(self.displayLink, displayLinkOutputCallback, UnsafeMutableRawPointer(Unmanaged.passUnretained(self).toOpaque()))
#else
self.displayLink = CADisplayLink(target: self,
selector: #selector(DisplayLink.displayTick))
self.displayLink!.add(to: .current, forMode: .common)
self.displayLink.add(to: .current, forMode: .common)
#endif
}

deinit {
self.stop()
#if os(macOS)
// Immediately remove callback to avoid access to the deallocated access to this object from the callback on a background thread
CVDisplayLinkSetOutputCallback(self.displayLink, nil, nil)
#endif
}


Expand Down Expand Up @@ -103,9 +106,7 @@ class DisplayLink: NSObject {
/// Starts the display link.
func start() {
self._currentFrame = 0

guard let displayLink = self.displayLink else { return }


#if os(macOS)
CVDisplayLinkStart(displayLink)
#else
Expand All @@ -115,12 +116,11 @@ class DisplayLink: NSObject {

/// Stops the display link.
func stop() {
guard let displayLink = self.displayLink else { return }

#if os(macOS)
// Must not be called on sync Main Thread, as it causes a deadlock there.
DispatchQueue.global().async {
CVDisplayLinkStop(displayLink)
DispatchQueue.global().async { [weak self] in
guard let self = self else { return }
CVDisplayLinkStop(self.displayLink)
}
#else
displayLink.isPaused = true
Expand All @@ -129,8 +129,6 @@ class DisplayLink: NSObject {

/// Whether the display link is currently running.
var isRunning : Bool {
guard let displayLink = self.displayLink else { return false }

#if os(macOS)
return CVDisplayLinkIsRunning(displayLink)
#else
Expand Down

0 comments on commit 1ad4ad7

Please sign in to comment.