mirror of
https://github.com/FBukovina/Atoll.git
synced 2026-10-27 15:14:33 +00:00
BugFix: Hide Notch from Screen Recordings
This commit is contained in:
parent
c555aa40a6
commit
18f68f56ea
18 changed files with 105 additions and 211 deletions
|
|
@ -232,7 +232,7 @@ struct GeneralSettings: View {
|
|||
NotificationCenter.default.post(name: Notification.Name.automaticallySwitchDisplayChanged, object: nil)
|
||||
}
|
||||
.disabled(showOnAllDisplays)
|
||||
Defaults.Toggle("Hide panels from screenshots & screen recordings", key: .hidePanelsFromScreenCapture)
|
||||
Defaults.Toggle("Hide Dynamic Island during screenshots & recordings", key: .hideDynamicIslandFromScreenCapture)
|
||||
} header: {
|
||||
Text("System features")
|
||||
}
|
||||
|
|
|
|||
|
|
@ -7,7 +7,6 @@
|
|||
|
||||
import AppKit
|
||||
import SwiftUI
|
||||
import Defaults
|
||||
import Sparkle
|
||||
|
||||
class SettingsWindowController: NSWindowController {
|
||||
|
|
@ -65,9 +64,7 @@ class SettingsWindowController: NSWindowController {
|
|||
// Handle window closing
|
||||
window.delegate = self
|
||||
|
||||
// Apply screen capture hiding setting
|
||||
updateScreenCaptureVisibility()
|
||||
setupScreenCaptureObserver()
|
||||
ScreenCaptureVisibilityManager.shared.register(window, scope: .panelsOnly)
|
||||
}
|
||||
|
||||
func showWindow() {
|
||||
|
|
@ -108,26 +105,9 @@ class SettingsWindowController: NSWindowController {
|
|||
NSApp.setActivationPolicy(.accessory)
|
||||
}
|
||||
|
||||
private func setupScreenCaptureObserver() {
|
||||
// Observe changes to hidePanelsFromScreenCapture setting
|
||||
Defaults.observe(.hidePanelsFromScreenCapture) { [weak self] change in
|
||||
DispatchQueue.main.async {
|
||||
self?.updateScreenCaptureVisibility()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private func updateScreenCaptureVisibility() {
|
||||
let shouldHide = Defaults[.hidePanelsFromScreenCapture]
|
||||
|
||||
if shouldHide {
|
||||
// Hide from screen capture and recording
|
||||
window?.sharingType = .none
|
||||
print("🙈 SettingsWindow: Hidden from screen capture and recordings")
|
||||
} else {
|
||||
// Allow normal screen capture
|
||||
window?.sharingType = .readOnly
|
||||
print("👁️ SettingsWindow: Visible in screen capture and recordings")
|
||||
deinit {
|
||||
if let window = window {
|
||||
ScreenCaptureVisibilityManager.shared.unregister(window)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue