@@ -45,7 +45,9 @@ use crate::{
4545 audio:: AppSounds ,
4646 auth:: AuthStore ,
4747 create_screenshot,
48- general_settings:: { GeneralSettingsStore , PostDeletionBehaviour , PostStudioRecordingBehaviour } ,
48+ general_settings:: {
49+ self , GeneralSettingsStore , PostDeletionBehaviour , PostStudioRecordingBehaviour ,
50+ } ,
4951 open_external_link,
5052 presets:: PresetsStore ,
5153 thumbnails:: * ,
@@ -474,6 +476,17 @@ pub async fn start_recording(
474476 recording_dir : recording_dir. clone ( ) ,
475477 } ;
476478
479+ #[ cfg( target_os = "macos" ) ]
480+ let excluded_windows = {
481+ let window_exclusions = general_settings
482+ . as_ref ( )
483+ . map_or_else ( general_settings:: default_excluded_windows, |settings| {
484+ settings. excluded_windows . clone ( )
485+ } ) ;
486+
487+ crate :: window_exclusion:: resolve_window_ids ( & window_exclusions)
488+ } ;
489+
477490 let actor = match inputs. mode {
478491 RecordingMode :: Studio => {
479492 let mut builder = studio_recording:: Actor :: builder (
@@ -487,6 +500,11 @@ pub async fn start_recording(
487500 . unwrap_or_default ( ) ,
488501 ) ;
489502
503+ #[ cfg( target_os = "macos" ) ]
504+ {
505+ builder = builder. with_excluded_windows ( excluded_windows. clone ( ) ) ;
506+ }
507+
490508 if let Some ( camera_feed) = camera_feed {
491509 builder = builder. with_camera_feed ( camera_feed) ;
492510 }
@@ -527,6 +545,11 @@ pub async fn start_recording(
527545 )
528546 . with_system_audio ( inputs. capture_system_audio ) ;
529547
548+ #[ cfg( target_os = "macos" ) ]
549+ {
550+ builder = builder. with_excluded_windows ( excluded_windows. clone ( ) ) ;
551+ }
552+
530553 if let Some ( mic_feed) = mic_feed {
531554 builder = builder. with_mic_feed ( mic_feed) ;
532555 }
@@ -576,7 +599,7 @@ pub async fn start_recording(
576599 )
577600 . kind ( tauri_plugin_dialog:: MessageDialogKind :: Error ) ;
578601
579- if let Some ( window) = CapWindowId :: InProgressRecording . get ( & app) {
602+ if let Some ( window) = CapWindowId :: RecordingControls . get ( & app) {
580603 dialog = dialog. parent ( & window) ;
581604 }
582605
@@ -618,7 +641,7 @@ pub async fn start_recording(
618641 )
619642 . kind ( tauri_plugin_dialog:: MessageDialogKind :: Error ) ;
620643
621- if let Some ( window) = CapWindowId :: InProgressRecording . get ( & app) {
644+ if let Some ( window) = CapWindowId :: RecordingControls . get ( & app) {
622645 dialog = dialog. parent ( & window) ;
623646 }
624647
@@ -718,7 +741,7 @@ pub async fn delete_recording(app: AppHandle, state: MutableState<'_, App>) -> R
718741 }
719742 } ;
720743
721- if let Some ( ( recording , recording_dir, video_id) ) = recording_data {
744+ if let Some ( ( _ , recording_dir, video_id) ) = recording_data {
722745 CurrentRecordingChanged . emit ( & app) . ok ( ) ;
723746 RecordingStopped { } . emit ( & app) . ok ( ) ;
724747
@@ -741,7 +764,7 @@ pub async fn delete_recording(app: AppHandle, state: MutableState<'_, App>) -> R
741764 . flatten ( )
742765 . unwrap_or_default ( ) ;
743766
744- if let Some ( window) = CapWindowId :: InProgressRecording . get ( & app) {
767+ if let Some ( window) = CapWindowId :: RecordingControls . get ( & app) {
745768 let _ = window. close ( ) ;
746769 }
747770
@@ -805,7 +828,7 @@ async fn handle_recording_end(
805828
806829 let _ = app. recording_logging_handle . reload ( None ) ;
807830
808- if let Some ( window) = CapWindowId :: InProgressRecording . get ( & handle) {
831+ if let Some ( window) = CapWindowId :: RecordingControls . get ( & handle) {
809832 let _ = window. close ( ) ;
810833 }
811834
0 commit comments