@@ -75,7 +75,15 @@ class AppDelegate: NSObject, NSApplicationDelegate {
7575 }
7676
7777 func setupMainWindow( ) {
78- let windowRect = NSRect ( x: 100 , y: 100 , width: 1280 , height: 720 )
78+ // Match the screen's aspect ratio for best preview quality
79+ let screen = NSScreen . main ?? NSScreen . screens. first!
80+ let screenSize = screen. frame. size
81+ let aspectRatio = screenSize. width / screenSize. height
82+
83+ // Use 75% of screen height for good size, maintain aspect ratio
84+ let windowHeight : CGFloat = min ( 900 , screenSize. height * 0.75 )
85+ let windowWidth = windowHeight * aspectRatio
86+ let windowRect = NSRect ( x: 0 , y: 0 , width: windowWidth, height: windowHeight)
7987
8088 window = NSWindow (
8189 contentRect: windowRect,
@@ -88,18 +96,23 @@ class AppDelegate: NSObject, NSApplicationDelegate {
8896 window. titlebarAppearsTransparent = true
8997 window. titleVisibility = . hidden
9098 window. isMovableByWindowBackground = true
91- window. minSize = NSSize ( width: 800 , height: 500 )
99+ window. minSize = NSSize ( width: 640 , height: 400 )
92100 window. isReleasedWhenClosed = false
93101 window. collectionBehavior = [ . fullScreenPrimary]
94- // Note: Don't use sharingType = .none here - it would hide from Google Meet/Zoom too!
95- // Instead, we exclude from our own capture via SCContentFilter
102+ window. aspectRatio = NSSize ( width: aspectRatio, height: 1 ) // Lock aspect ratio
103+
104+ // Hide from external screen capture until sharing starts
105+ // This prevents Google Meet/Zoom from seeing the settings screen
106+ window. sharingType = . none
96107
97108 mainView = MainView ( frame: windowRect)
98109 mainView. delegate = self
99110 mainView. settingsDelegate = self
100111 mainView. hotkeyManager = hotkeyManager
101112 window. contentView = mainView
102113
114+ // Center the window on screen
115+ window. center ( )
103116 window. makeKeyAndOrderFront ( nil )
104117 }
105118
@@ -127,6 +140,9 @@ class AppDelegate: NSObject, NSApplicationDelegate {
127140 @objc func startCapture( ) {
128141 mainView. showCapturing ( )
129142
143+ // Make window visible to external screen capture (Google Meet, Zoom, etc.)
144+ window. sharingType = . readOnly
145+
130146 // Ensure HUD window exists so it can be excluded
131147 if hudWindow == nil {
132148 hudWindow = HUDWindow ( )
@@ -157,6 +173,10 @@ class AppDelegate: NSObject, NSApplicationDelegate {
157173 @objc func stopCapture( ) {
158174 captureEngine? . stopCapture ( )
159175 captureEngine = nil
176+
177+ // Hide window from external screen capture again
178+ window. sharingType = . none
179+
160180 mainView. showStartScreen ( )
161181 updateStatusBarIcon ( isPrivate: false )
162182 }
0 commit comments