Skip to content

Commit c68f3b5

Browse files
Release version v2.7.3
2 parents 16b0f11 + 43ef9d3 commit c68f3b5

29 files changed

+2419
-1104
lines changed

BoringNotchXPCHelper/BoringNotchXPCHelper.swift

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ class BoringNotchXPCHelper: NSObject, BoringNotchXPCHelperProtocol {
1717
}
1818

1919
@objc func requestAccessibilityAuthorization() {
20-
let options: CFDictionary = [kAXTrustedCheckOptionPrompt.takeUnretainedValue() as String: true] as CFDictionary
21-
_ = AXIsProcessTrustedWithOptions(options)
20+
let options = [kAXTrustedCheckOptionPrompt.takeUnretainedValue() as String: true] as CFDictionary
21+
AXIsProcessTrustedWithOptions(options)
2222
}
2323

2424
@objc func ensureAccessibilityAuthorization(_ promptIfNeeded: Bool, with reply: @escaping (Bool) -> Void) {
@@ -28,8 +28,7 @@ class BoringNotchXPCHelper: NSObject, BoringNotchXPCHelperProtocol {
2828
}
2929

3030
if promptIfNeeded {
31-
let options: CFDictionary = [kAXTrustedCheckOptionPrompt.takeUnretainedValue() as String: true] as CFDictionary
32-
_ = AXIsProcessTrustedWithOptions(options)
31+
requestAccessibilityAuthorization()
3332
}
3433

3534
DispatchQueue.main.asyncAfter(deadline: .now() + 0.5) {

boringNotch.xcodeproj/project.pbxproj

Lines changed: 14 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@
3939
1153BD9A2D98824300979FB0 /* SpotifyController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1153BD992D98824300979FB0 /* SpotifyController.swift */; };
4040
1153BD9C2D98853B00979FB0 /* NowPlayingController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1153BD9B2D98853B00979FB0 /* NowPlayingController.swift */; };
4141
1153BDA72D99B22200979FB0 /* YouTubeMusicController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1153BDA62D99B22200979FB0 /* YouTubeMusicController.swift */; };
42+
115C12EC2ED3D003009754CA /* OpenNotchHUD.swift in Sources */ = {isa = PBXBuildFile; fileRef = 115C12EB2ED3D003009754CA /* OpenNotchHUD.swift */; };
4243
1160F8D82DD98230006FBB94 /* NotchShape.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1160F8D72DD98230006FBB94 /* NotchShape.swift */; };
4344
1163988D2DF5CAB40052E6AF /* EventModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1163988C2DF5CAB40052E6AF /* EventModel.swift */; };
4445
1163988F2DF5CC870052E6AF /* CalendarModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1163988E2DF5CC870052E6AF /* CalendarModel.swift */; };
@@ -102,7 +103,6 @@
102103
14D570CB2C5F4B2C0011E668 /* BatteryStatusViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 14D570CA2C5F4B2C0011E668 /* BatteryStatusViewModel.swift */; };
103104
14D570CD2C5F4BB70011E668 /* BoringBattery.swift in Sources */ = {isa = PBXBuildFile; fileRef = 14D570CC2C5F4BB70011E668 /* BoringBattery.swift */; };
104105
14D570D22C5F6C6A0011E668 /* BoringExtrasMenu.swift in Sources */ = {isa = PBXBuildFile; fileRef = 14D570D12C5F6C6A0011E668 /* BoringExtrasMenu.swift */; };
105-
14D570D52C5F710B0011E668 /* constants.swift in Sources */ = {isa = PBXBuildFile; fileRef = 14D570D42C5F710B0011E668 /* constants.swift */; };
106106
14E9FEAA2C70BF610062E83F /* DownloadView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 14E9FEA92C70BF610062E83F /* DownloadView.swift */; };
107107
14E9FEAE2C7325770062E83F /* Button+Bouncing.swift in Sources */ = {isa = PBXBuildFile; fileRef = 14E9FEAD2C7325770062E83F /* Button+Bouncing.swift */; };
108108
14FC6E502C7DED5600C7BEA5 /* DataTypes+Extensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = 14FC6E4F2C7DED5600C7BEA5 /* DataTypes+Extensions.swift */; };
@@ -209,6 +209,7 @@
209209
1153BD992D98824300979FB0 /* SpotifyController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SpotifyController.swift; sourceTree = "<group>"; };
210210
1153BD9B2D98853B00979FB0 /* NowPlayingController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NowPlayingController.swift; sourceTree = "<group>"; };
211211
1153BDA62D99B22200979FB0 /* YouTubeMusicController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YouTubeMusicController.swift; sourceTree = "<group>"; };
212+
115C12EB2ED3D003009754CA /* OpenNotchHUD.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = OpenNotchHUD.swift; sourceTree = "<group>"; };
212213
1160F8D72DD98230006FBB94 /* NotchShape.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NotchShape.swift; sourceTree = "<group>"; };
213214
1163988C2DF5CAB40052E6AF /* EventModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = EventModel.swift; sourceTree = "<group>"; };
214215
1163988E2DF5CC870052E6AF /* CalendarModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CalendarModel.swift; sourceTree = "<group>"; };
@@ -272,7 +273,6 @@
272273
14D570CA2C5F4B2C0011E668 /* BatteryStatusViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BatteryStatusViewModel.swift; sourceTree = "<group>"; };
273274
14D570CC2C5F4BB70011E668 /* BoringBattery.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BoringBattery.swift; sourceTree = "<group>"; };
274275
14D570D12C5F6C6A0011E668 /* BoringExtrasMenu.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BoringExtrasMenu.swift; sourceTree = "<group>"; };
275-
14D570D42C5F710B0011E668 /* constants.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = constants.swift; sourceTree = "<group>"; };
276276
14E9FEA92C70BF610062E83F /* DownloadView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DownloadView.swift; sourceTree = "<group>"; };
277277
14E9FEAD2C7325770062E83F /* Button+Bouncing.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "Button+Bouncing.swift"; sourceTree = "<group>"; };
278278
14FC6E4F2C7DED5600C7BEA5 /* DataTypes+Extensions.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "DataTypes+Extensions.swift"; sourceTree = "<group>"; };
@@ -567,7 +567,6 @@
567567
14288DD92C6E015000B9F80C /* helpers */,
568568
B186543A2C6F49A4000B926A /* Shortcuts */,
569569
1443E7F12C609DB90027C1FC /* sizing */,
570-
14D570D32C5F70FA0011E668 /* strings */,
571570
14D570C72C5F38760011E668 /* models */,
572571
14D570BA2C5E98E30011E668 /* enums */,
573572
14D570B72C5E98960011E668 /* animations */,
@@ -639,14 +638,6 @@
639638
path = models;
640639
sourceTree = "<group>";
641640
};
642-
14D570D32C5F70FA0011E668 /* strings */ = {
643-
isa = PBXGroup;
644-
children = (
645-
14D570D42C5F710B0011E668 /* constants.swift */,
646-
);
647-
path = strings;
648-
sourceTree = "<group>";
649-
};
650641
9A0887332C7AFF7E00C160EA /* Tabs */ = {
651642
isa = PBXGroup;
652643
children = (
@@ -739,6 +730,7 @@
739730
B18654312C6F45AE000B926A /* Live activities */ = {
740731
isa = PBXGroup;
741732
children = (
733+
115C12EB2ED3D003009754CA /* OpenNotchHUD.swift */,
742734
14D570CC2C5F4BB70011E668 /* BoringBattery.swift */,
743735
B1C974332C642B6D0000E707 /* MarqueeTextView.swift */,
744736
B1D365CD2C6A979C0047BDBC /* LiveActivityModifier.swift */,
@@ -913,6 +905,7 @@
913905
isa = PBXSourcesBuildPhase;
914906
buildActionMask = 2147483647;
915907
files = (
908+
115C12EC2ED3D003009754CA /* OpenNotchHUD.swift in Sources */,
916909
14C08BB92C8DE4B1000F8AA0 /* BoringCalendar.swift in Sources */,
917910
5955950D2E900ED800C66711 /* ApplicationRelauncher.swift in Sources */,
918911
1100292A2E8691B400035A57 /* FileShareView.swift in Sources */,
@@ -986,7 +979,6 @@
986979
B10F84A32C6C9596009F3026 /* TestView.swift in Sources */,
987980
1443E7F32C609DCE0027C1FC /* matters.swift in Sources */,
988981
11C5E3162DFE88510065821E /* SettingsView.swift in Sources */,
989-
14D570D52C5F710B0011E668 /* constants.swift in Sources */,
990982
1153BD932D986E4300979FB0 /* AppleMusicController.swift in Sources */,
991983
11C5E3132DFE85970065821E /* SettingsWindowController.swift in Sources */,
992984
110029272E84FD4C00035A57 /* TemporaryFileStorageService.swift in Sources */,
@@ -1050,14 +1042,14 @@
10501042
"CODE_SIGN_IDENTITY[sdk=macosx*]" = "-";
10511043
CODE_SIGN_STYLE = Automatic;
10521044
COMBINE_HIDPI_IMAGES = YES;
1053-
CURRENT_PROJECT_VERSION = 262;
1045+
CURRENT_PROJECT_VERSION = 271;
10541046
DEVELOPMENT_TEAM = "";
10551047
GENERATE_INFOPLIST_FILE = YES;
10561048
INFOPLIST_FILE = BoringNotchXPCHelper/Info.plist;
10571049
INFOPLIST_KEY_CFBundleDisplayName = BoringNotchXPCHelper;
10581050
INFOPLIST_KEY_NSHumanReadableCopyright = "";
1059-
MACOSX_DEPLOYMENT_TARGET = 15.5;
1060-
MARKETING_VERSION = 2.7.2;
1051+
MACOSX_DEPLOYMENT_TARGET = 14.0;
1052+
MARKETING_VERSION = 2.7.3;
10611053
PRODUCT_BUNDLE_IDENTIFIER = theboringteam.boringnotch.BoringNotchXPCHelper;
10621054
PRODUCT_NAME = "$(TARGET_NAME)";
10631055
REGISTER_APP_GROUPS = YES;
@@ -1075,14 +1067,14 @@
10751067
"CODE_SIGN_IDENTITY[sdk=macosx*]" = "-";
10761068
CODE_SIGN_STYLE = Automatic;
10771069
COMBINE_HIDPI_IMAGES = YES;
1078-
CURRENT_PROJECT_VERSION = 262;
1070+
CURRENT_PROJECT_VERSION = 271;
10791071
DEVELOPMENT_TEAM = "";
10801072
GENERATE_INFOPLIST_FILE = YES;
10811073
INFOPLIST_FILE = BoringNotchXPCHelper/Info.plist;
10821074
INFOPLIST_KEY_CFBundleDisplayName = BoringNotchXPCHelper;
10831075
INFOPLIST_KEY_NSHumanReadableCopyright = "";
1084-
MACOSX_DEPLOYMENT_TARGET = 15.5;
1085-
MARKETING_VERSION = 2.7.2;
1076+
MACOSX_DEPLOYMENT_TARGET = 14.0;
1077+
MARKETING_VERSION = 2.7.3;
10861078
PRODUCT_BUNDLE_IDENTIFIER = theboringteam.boringnotch.BoringNotchXPCHelper;
10871079
PRODUCT_NAME = "$(TARGET_NAME)";
10881080
REGISTER_APP_GROUPS = YES;
@@ -1229,7 +1221,7 @@
12291221
"CODE_SIGN_IDENTITY[sdk=macosx*]" = "-";
12301222
CODE_SIGN_STYLE = Automatic;
12311223
COMBINE_HIDPI_IMAGES = YES;
1232-
CURRENT_PROJECT_VERSION = 262;
1224+
CURRENT_PROJECT_VERSION = 271;
12331225
DEAD_CODE_STRIPPING = YES;
12341226
DEVELOPMENT_ASSET_PATHS = "\"boringNotch/Preview Content\"";
12351227
DEVELOPMENT_TEAM = "";
@@ -1256,7 +1248,7 @@
12561248
"@executable_path/../Frameworks",
12571249
);
12581250
MACOSX_DEPLOYMENT_TARGET = 14.0;
1259-
MARKETING_VERSION = 2.7.2;
1251+
MARKETING_VERSION = 2.7.3;
12601252
PRODUCT_BUNDLE_IDENTIFIER = theboringteam.boringnotch;
12611253
PRODUCT_NAME = "$(TARGET_NAME)";
12621254
PROVISIONING_PROFILE_SPECIFIER = "";
@@ -1283,7 +1275,7 @@
12831275
"CODE_SIGN_IDENTITY[sdk=macosx*]" = "-";
12841276
CODE_SIGN_STYLE = Automatic;
12851277
COMBINE_HIDPI_IMAGES = YES;
1286-
CURRENT_PROJECT_VERSION = 262;
1278+
CURRENT_PROJECT_VERSION = 271;
12871279
DEAD_CODE_STRIPPING = YES;
12881280
DEVELOPMENT_ASSET_PATHS = "\"boringNotch/Preview Content\"";
12891281
DEVELOPMENT_TEAM = "";
@@ -1309,7 +1301,7 @@
13091301
"@executable_path/../Frameworks",
13101302
);
13111303
MACOSX_DEPLOYMENT_TARGET = 14.0;
1312-
MARKETING_VERSION = 2.7.2;
1304+
MARKETING_VERSION = 2.7.3;
13131305
PRODUCT_BUNDLE_IDENTIFIER = theboringteam.boringnotch;
13141306
PRODUCT_NAME = "$(TARGET_NAME)";
13151307
PROVISIONING_PROFILE_SPECIFIER = "";

boringNotch/BoringViewCoordinator.swift

Lines changed: 9 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ class BoringViewCoordinator: ObservableObject {
5151
static let shared = BoringViewCoordinator()
5252

5353
@Published var currentView: NotchViews = .home
54+
@Published var helloAnimationRunning: Bool = false
5455
private var sneakPeekDispatch: DispatchWorkItem?
5556
private var expandingViewDispatch: DispatchWorkItem?
5657
private var hudEnableTask: Task<Void, Never>?
@@ -126,18 +127,10 @@ class BoringViewCoordinator: ObservableObject {
126127
forName: Notification.Name.accessibilityAuthorizationChanged,
127128
object: nil,
128129
queue: .main
129-
) { [weak self] _ in
130+
) { _ in
130131
Task { @MainActor in
131-
guard let self = self else { return }
132-
let granted = await XPCHelperClient.shared.isAccessibilityAuthorized()
133-
if !granted {
134-
// If permission was revoked, disable HUD replacement
135-
Defaults[.hudReplacement] = false
136-
} else {
137-
// If permission granted and user prefers HUD replacement, ensure interceptor is running
138-
if Defaults[.hudReplacement] {
139-
MediaKeyInterceptor.shared.start(requireAccessibility: true, promptIfNeeded: false)
140-
}
132+
if Defaults[.hudReplacement] {
133+
await MediaKeyInterceptor.shared.start(promptIfNeeded: false)
141134
}
142135
}
143136
}
@@ -153,23 +146,11 @@ class BoringViewCoordinator: ObservableObject {
153146

154147
if change.newValue {
155148
self.hudEnableTask = Task { @MainActor in
156-
// Check prior authorization so we only restart if permissions were newly granted
157-
let priorAuthorized = await XPCHelperClient.shared.isAccessibilityAuthorized()
158-
159-
MediaKeyInterceptor.shared.start(requireAccessibility: true, promptIfNeeded: true)
160-
161-
let granted = await MediaKeyInterceptor.shared.ensureAccessibilityAuthorization(promptIfNeeded: false)
162-
149+
let granted = await XPCHelperClient.shared.ensureAccessibilityAuthorization(promptIfNeeded: true)
163150
if Task.isCancelled { return }
164151

165152
if granted {
166-
// Restart only if authorization was newly granted
167-
if !priorAuthorized {
168-
// newly granted; restart
169-
ApplicationRelauncher.restart()
170-
} else {
171-
// already granted; no restart needed
172-
}
153+
await MediaKeyInterceptor.shared.start()
173154
} else {
174155
Defaults[.hudReplacement] = false
175156
}
@@ -180,14 +161,15 @@ class BoringViewCoordinator: ObservableObject {
180161
}
181162
}
182163

183-
// On startup, ensure the hudReplacement state reflects current authorization
184164
Task { @MainActor in
165+
helloAnimationRunning = firstLaunch
166+
185167
if Defaults[.hudReplacement] {
186168
let authorized = await XPCHelperClient.shared.isAccessibilityAuthorized()
187169
if !authorized {
188170
Defaults[.hudReplacement] = false
189171
} else {
190-
MediaKeyInterceptor.shared.start(requireAccessibility: true, promptIfNeeded: false)
172+
await MediaKeyInterceptor.shared.start(promptIfNeeded: false)
191173
}
192174
}
193175
}

boringNotch/ContentView.swift

Lines changed: 7 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -146,18 +146,6 @@ struct ContentView: View {
146146
handleUpGesture(translation: translation, phase: phase)
147147
}
148148
}
149-
.onAppear {
150-
Task {
151-
try? await Task.sleep(for: .seconds(1))
152-
await MainActor.run {
153-
if coordinator.firstLaunch {
154-
withAnimation(vm.animation) {
155-
doOpen()
156-
}
157-
}
158-
}
159-
}
160-
}
161149
.onReceive(NotificationCenter.default.publisher(for: .sharingDidFinish)) { _ in
162150
if vm.notchState == .open && !isHovering && !vm.isBatteryPopoverActive {
163151
hoverTask?.cancel()
@@ -222,6 +210,7 @@ struct ContentView: View {
222210
)
223211
.animation(.smooth, value: gestureProgress)
224212
.background(dragDetector)
213+
.preferredColorScheme(.dark)
225214
.environmentObject(vm)
226215
.onChange(of: vm.anyDropZoneTargeting) { _, isTargeted in
227216
anyDropDebounceTask?.cancel()
@@ -255,14 +244,14 @@ struct ContentView: View {
255244
func NotchLayout() -> some View {
256245
VStack(alignment: .leading) {
257246
VStack(alignment: .leading) {
258-
if coordinator.firstLaunch {
247+
if coordinator.helloAnimationRunning {
259248
Spacer()
260-
HelloAnimation().frame(
249+
HelloAnimation(onFinish: {
250+
vm.closeHello()
251+
}).frame(
261252
width: getClosedNotchSize().width,
262253
height: 80
263-
).onAppear(perform: {
264-
vm.closeHello()
265-
})
254+
)
266255
.padding(.top, 40)
267256
Spacer()
268257
} else {
@@ -520,6 +509,7 @@ struct ContentView: View {
520509
// MARK: - Hover Management
521510

522511
private func handleHover(_ hovering: Bool) {
512+
if coordinator.firstLaunch { return }
523513
hoverTask?.cancel()
524514

525515
if hovering {

0 commit comments

Comments
 (0)