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
|
|
@ -60,9 +60,12 @@ class ClipboardWindowManager: ObservableObject {
|
|||
window.contentView = hostingView
|
||||
|
||||
// Handle window closing
|
||||
window.delegate = WindowDelegate { [weak self] in
|
||||
window.delegate = WindowDelegate { [weak self] window in
|
||||
ScreenCaptureVisibilityManager.shared.unregister(window)
|
||||
self?.clipboardWindow = nil
|
||||
}
|
||||
|
||||
ScreenCaptureVisibilityManager.shared.register(window, scope: .panelsOnly)
|
||||
|
||||
self.clipboardWindow = window
|
||||
window.makeKeyAndOrderFront(nil)
|
||||
|
|
@ -88,21 +91,17 @@ class ClipboardWindowManager: ObservableObject {
|
|||
}
|
||||
|
||||
private class WindowDelegate: NSObject, NSWindowDelegate {
|
||||
private let onClose: () -> Void
|
||||
|
||||
init(onClose: @escaping () -> Void) {
|
||||
private let onClose: (NSWindow) -> Void
|
||||
|
||||
init(onClose: @escaping (NSWindow) -> Void) {
|
||||
self.onClose = onClose
|
||||
super.init()
|
||||
}
|
||||
|
||||
func windowWillClose(_ notification: Notification) {
|
||||
onClose()
|
||||
}
|
||||
|
||||
|
||||
func windowShouldClose(_ sender: NSWindow) -> Bool {
|
||||
// Hide instead of close when user clicks close button
|
||||
sender.orderOut(nil)
|
||||
onClose()
|
||||
onClose(sender)
|
||||
return false
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -70,6 +70,8 @@ class LockScreenLiveActivityWindowManager {
|
|||
window.alphaValue = 0
|
||||
window.animationBehavior = .none
|
||||
|
||||
ScreenCaptureVisibilityManager.shared.register(window, scope: .entireInterface)
|
||||
|
||||
self.window = window
|
||||
self.hasDelegated = false
|
||||
return window
|
||||
|
|
|
|||
|
|
@ -81,6 +81,8 @@ class LockScreenPanelManager {
|
|||
newWindow.isMovable = false
|
||||
newWindow.hasShadow = false
|
||||
|
||||
ScreenCaptureVisibilityManager.shared.register(newWindow, scope: .entireInterface)
|
||||
|
||||
panelWindow = newWindow
|
||||
window = newWindow
|
||||
hasDelegated = false
|
||||
|
|
|
|||
|
|
@ -70,6 +70,8 @@ final class LockScreenReminderWidgetPanelManager {
|
|||
newWindow.level = NSWindow.Level(rawValue: Int(CGShieldingWindowLevel()))
|
||||
newWindow.collectionBehavior = [.canJoinAllSpaces, .stationary, .fullScreenAuxiliary]
|
||||
|
||||
ScreenCaptureVisibilityManager.shared.register(newWindow, scope: .entireInterface)
|
||||
|
||||
window = newWindow
|
||||
if !hasDelegated {
|
||||
SkyLightOperator.shared.delegateWindow(newWindow)
|
||||
|
|
|
|||
|
|
@ -78,6 +78,8 @@ final class LockScreenWeatherPanelManager {
|
|||
newWindow.level = NSWindow.Level(rawValue: Int(CGShieldingWindowLevel()))
|
||||
newWindow.collectionBehavior = [.canJoinAllSpaces, .stationary, .fullScreenAuxiliary]
|
||||
|
||||
ScreenCaptureVisibilityManager.shared.register(newWindow, scope: .entireInterface)
|
||||
|
||||
window = newWindow
|
||||
if !hasDelegated {
|
||||
SkyLightOperator.shared.delegateWindow(newWindow)
|
||||
|
|
|
|||
|
|
@ -166,6 +166,8 @@ final class MusicControlWindowManager {
|
|||
window.isMovable = false
|
||||
window.alphaValue = 0
|
||||
|
||||
ScreenCaptureVisibilityManager.shared.register(window, scope: .entireInterface)
|
||||
|
||||
self.window = window
|
||||
self.hasDelegated = false
|
||||
return window
|
||||
|
|
|
|||
|
|
@ -145,6 +145,8 @@ final class TimerControlWindowManager {
|
|||
window.isMovable = false
|
||||
window.alphaValue = 0
|
||||
|
||||
ScreenCaptureVisibilityManager.shared.register(window, scope: .entireInterface)
|
||||
|
||||
self.window = window
|
||||
self.hasDelegated = false
|
||||
return window
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue