Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
glouel committed Aug 16, 2023
1 parent 8c78e7c commit 0fe3461
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 5 deletions.
8 changes: 4 additions & 4 deletions Aerial.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -3241,15 +3241,15 @@
CODE_SIGN_IDENTITY = "Developer ID Application";
CODE_SIGN_STYLE = Manual;
COMBINE_HIDPI_IMAGES = YES;
CURRENT_PROJECT_VERSION = 3.2.7beta6a1;
CURRENT_PROJECT_VERSION = 3.2.7beta6a2;
DEFINES_MODULE = YES;
DEVELOPMENT_TEAM = 3L54M5L5KK;
ENABLE_HARDENED_RUNTIME = YES;
INFOPLIST_FILE = "$(SRCROOT)/Resources/Old stuff/Info.plist";
INSTALL_PATH = "$(HOME)/Library/Screen Savers";
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/../Frameworks";
MACOSX_DEPLOYMENT_TARGET = 10.13;
MARKETING_VERSION = 3.2.7beta6a1;
MARKETING_VERSION = 3.2.7beta6a2;
PRODUCT_BUNDLE_IDENTIFIER = com.johncoates.Aerial;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
Expand All @@ -3270,15 +3270,15 @@
CODE_SIGN_IDENTITY = "Developer ID Application";
CODE_SIGN_STYLE = Manual;
COMBINE_HIDPI_IMAGES = YES;
CURRENT_PROJECT_VERSION = 3.2.7beta6a1;
CURRENT_PROJECT_VERSION = 3.2.7beta6a2;
DEFINES_MODULE = YES;
DEVELOPMENT_TEAM = 3L54M5L5KK;
ENABLE_HARDENED_RUNTIME = YES;
INFOPLIST_FILE = "$(SRCROOT)/Resources/Old stuff/Info.plist";
INSTALL_PATH = "$(HOME)/Library/Screen Savers";
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/../Frameworks";
MACOSX_DEPLOYMENT_TARGET = 10.13;
MARKETING_VERSION = 3.2.7beta6a1;
MARKETING_VERSION = 3.2.7beta6a2;
OTHER_CODE_SIGN_FLAGS = "--timestamp";
PRODUCT_BUNDLE_IDENTIFIER = com.johncoates.Aerial;
PRODUCT_NAME = "$(TARGET_NAME)";
Expand Down
11 changes: 10 additions & 1 deletion Aerial/Source/Views/AerialView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -462,7 +462,6 @@ final class AerialView: ScreenSaverView, CAAnimationDelegate {
VideoManager.sharedInstance.cancelAll()

debugLog("🖼️ end teardown, exiting")
exit(0)
}

// Wait for the player to be ready
Expand Down Expand Up @@ -543,6 +542,9 @@ final class AerialView: ScreenSaverView, CAAnimationDelegate {
name: NSNotification.Name.AVPlayerItemPlaybackStalled,
object: currentItem)

NSWorkspace.shared.notificationCenter.addObserver(
self, selector: #selector(onSleepNote(note:)),
name: NSWorkspace.willSleepNotification, object: nil)

DistributedNotificationCenter.default.addObserver(self,
selector: #selector(AerialView.willStart(_:)),
Expand Down Expand Up @@ -587,6 +589,13 @@ final class AerialView: ScreenSaverView, CAAnimationDelegate {
}
}

@objc func onSleepNote(note: Notification) {
debugLog("🖼️ 📢📢📢 onSleepNote")
if #available(macOS 14.0, *) {
exit(0)
}
}

@objc func willStop(_ aNotification: Notification) {
DisplayDetection.sharedInstance.resetUnusedScreens()

Expand Down

0 comments on commit 0fe3461

Please sign in to comment.