File tree Expand file tree Collapse file tree 3 files changed +14
-13
lines changed
src/routes/(window-chrome)/new-main Expand file tree Collapse file tree 3 files changed +14
-13
lines changed Original file line number Diff line number Diff line change @@ -268,16 +268,11 @@ impl WindowFocusManager {
268268 let cap_main = CapWindowId :: Main . get ( app) ;
269269 let cap_settings = CapWindowId :: Settings . get ( app) ;
270270
271- let has_cap_main = cap_main
272- . as_ref ( )
273- . and_then ( |v| Some ( v. is_minimized ( ) . ok ( ) ? || !v. is_visible ( ) . ok ( ) ?) )
274- . unwrap_or ( true ) ;
275- let has_cap_settings = cap_settings
276- . and_then ( |v| Some ( v. is_minimized ( ) . ok ( ) ? || !v. is_visible ( ) . ok ( ) ?) )
277- . unwrap_or ( true ) ;
278-
279- // Close the overlay if the cap main and settings are not available.
280- if has_cap_main && has_cap_settings {
271+ let main_window_available = cap_main. is_some ( ) ;
272+ let settings_window_available = cap_settings. is_some ( ) ;
273+
274+ // Close the overlay if both cap windows are gone.
275+ if !main_window_available && !settings_window_available {
281276 window. hide ( ) . ok ( ) ;
282277 break ;
283278 }
Original file line number Diff line number Diff line change @@ -224,6 +224,8 @@ impl ShowCapWindow {
224224 }
225225
226226 if let Some ( window) = self . id ( app) . get ( app) {
227+ window. show ( ) . ok ( ) ;
228+ window. unminimize ( ) . ok ( ) ;
227229 window. set_focus ( ) . ok ( ) ;
228230 return Ok ( window) ;
229231 }
Original file line number Diff line number Diff line change @@ -53,6 +53,7 @@ import {
5353 type CaptureWindowWithThumbnail ,
5454 commands ,
5555 type DeviceOrModelID ,
56+ type RecordingTargetMode ,
5657 type ScreenCaptureTarget ,
5758} from "~/utils/tauri" ;
5859import IconLucideAppWindowMac from "~icons/lucide/app-window-mac" ;
@@ -434,10 +435,13 @@ function Page() {
434435 createUpdateCheck ( ) ;
435436
436437 onMount ( async ( ) => {
437- const targetMode = ( window as any ) . __CAP__ . initialTargetMode ;
438+ const { __CAP__ } = window as typeof window & {
439+ __CAP__ ?: { initialTargetMode ?: RecordingTargetMode | null } ;
440+ } ;
441+ const targetMode = __CAP__ ?. initialTargetMode ?? null ;
438442 setOptions ( { targetMode } ) ;
439- if ( rawOptions . targetMode ) commands . openTargetSelectOverlays ( null ) ;
440- else commands . closeTargetSelectOverlays ( ) ;
443+ if ( targetMode ) await commands . openTargetSelectOverlays ( null ) ;
444+ else await commands . closeTargetSelectOverlays ( ) ;
441445
442446 const currentWindow = getCurrentWindow ( ) ;
443447
You can’t perform that action at this time.
0 commit comments