BugFix: Hide Notch from Screen Recordings

This commit is contained in:
Hariharan Mudaliar 2025-11-26 15:48:07 +05:30
commit 18f68f56ea
18 changed files with 105 additions and 211 deletions

View file

@ -57,9 +57,7 @@ class ScreenAssistantPanel: NSPanel {
.fullScreenAuxiliary
]
// Apply screen capture hiding setting
updateScreenCaptureVisibility()
setupScreenCaptureObserver()
ScreenCaptureVisibilityManager.shared.register(self, scope: .panelsOnly)
// Set minimal size since this is just a wrapper
setContentSize(CGSize(width: 1, height: 1))
@ -77,27 +75,8 @@ class ScreenAssistantPanel: NSPanel {
super.close()
}
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
self.sharingType = .none
print("🙈 ScreenAssistantPanel: Hidden from screen capture and recordings")
} else {
// Allow normal screen capture
self.sharingType = .readOnly
print("👁️ ScreenAssistantPanel: Visible in screen capture and recordings")
}
deinit {
ScreenCaptureVisibilityManager.shared.unregister(self)
}
}