@@ -251,6 +251,7 @@ wrap_app! {
251251 pub struct TauriApp <T : UserEvent > {
252252 context: Context <T >,
253253 custom_schemes: Vec <String >,
254+ command_line_args: Vec <( String , Option <String >) >,
254255 }
255256
256257 impl App {
@@ -270,6 +271,25 @@ wrap_app! {
270271 }
271272 }
272273 }
274+
275+ fn on_before_command_line_processing(
276+ & self ,
277+ _process_type: Option <& CefString >,
278+ command_line: Option <& mut CommandLine >,
279+ ) {
280+ if let Some ( command_line) = command_line {
281+ for ( arg, value) in & self . command_line_args {
282+ if let Some ( value) = value {
283+ command_line. append_switch_with_value(
284+ Some ( & CefString :: from( arg. as_str( ) ) ) ,
285+ Some ( & CefString :: from( value. as_str( ) ) ) ,
286+ ) ;
287+ } else {
288+ command_line. append_switch( Some ( & CefString :: from( arg. as_str( ) ) ) ) ;
289+ }
290+ }
291+ }
292+ }
273293 }
274294}
275295
@@ -667,7 +687,9 @@ wrap_window_delegate! {
667687 . unwrap_or( 1.0 ) ;
668688 let mut min_w: i32 = 0 ;
669689 let mut min_h: i32 = 0 ;
670- let attributes = self . attributes. borrow( ) ;
690+ let Ok ( attributes) = self . attributes. try_borrow( ) else {
691+ return cef:: Size { width: 0 , height: 0 } ;
692+ } ;
671693 if let Some ( min_size) = attributes. min_inner_size {
672694 let logical = min_size. to_logical:: <u32 >( scale) ;
673695 min_w = min_w. max( logical. width as i32 ) ;
@@ -699,7 +721,10 @@ wrap_window_delegate! {
699721 . unwrap_or( 1.0 ) ;
700722 let mut max_w: Option <i32 > = None ;
701723 let mut max_h: Option <i32 > = None ;
702- let attributes = self . attributes. borrow( ) ;
724+ let Ok ( attributes) = self . attributes. try_borrow( ) else {
725+ return cef:: Size { width: 0 , height: 0 } ;
726+ } ;
727+
703728 if let Some ( max_size) = attributes. max_inner_size {
704729 let logical = max_size. to_logical:: <u32 >( scale) ;
705730 max_w = Some ( logical. width as i32 ) ;
@@ -731,7 +756,9 @@ wrap_window_delegate! {
731756 return ;
732757 } ;
733758
734- if let Some ( app_window) = self . windows. borrow( ) . get( & self . window_id) {
759+ let Ok ( windows) = self . windows. try_borrow( ) else { return ; } ;
760+
761+ if let Some ( app_window) = windows. get( & self . window_id) {
735762 for wrapper in & app_window. webviews {
736763 if let ( Some ( overlay) , Some ( b) ) = ( & wrapper. overlay, & * wrapper. bounds. lock( ) . unwrap( ) ) {
737764 let new_rect = cef:: Rect {
0 commit comments