mirror of
https://github.com/MonitorControl/MonitorControl.git
synced 2026-06-30 06:02:00 -06:00
Only exclude shade from capture on non-virtual displays
Virtual displays (AirPlay/Sidecar/DisplayLink) are themselves presented to the physical monitor via screen capture. Setting sharingType=.none on their shade would remove the dimming from the actual monitor, not just from screenshots. Guard the opt-out with !isVirtual so DisplayLink etc. keep dimming, while real displays using shade (e.g. Mac mini HDMI) still get screenshot-clean dimming.
This commit is contained in:
parent
ed07a0ca53
commit
4d62fa90e0
1 changed files with 8 additions and 1 deletions
|
|
@ -71,7 +71,14 @@ class DisplayManager {
|
|||
shade.backgroundColor = .clear
|
||||
shade.ignoresMouseEvents = true
|
||||
shade.level = NSWindow.Level(rawValue: Int(CGShieldingWindowLevel()))
|
||||
shade.sharingType = .none // dimming overlay must not appear in screenshots / screen recordings
|
||||
// Hiding the shade from screen capture is only safe on real displays. On VIRTUAL
|
||||
// displays (AirPlay / Sidecar / DisplayLink) macOS presents the display itself via
|
||||
// screen capture, so a non-capturable shade would also disappear from the physical
|
||||
// monitor and stop dimming it. Only opt these shades out of capture when the display
|
||||
// is not virtual (e.g. a Mac mini HDMI / blacklisted display using shade dimming).
|
||||
if !DisplayManager.isVirtual(displayID: displayID) {
|
||||
shade.sharingType = .none // dimming overlay must not appear in screenshots / screen recordings
|
||||
}
|
||||
shade.orderFrontRegardless()
|
||||
shade.collectionBehavior = [.stationary, .canJoinAllSpaces, .ignoresCycle]
|
||||
shade.setFrame(screen.frame, display: true)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue