@@ -368,7 +368,8 @@ fn sync_main(rt: tokio::runtime::Runtime) -> Result<()> {
368368 }
369369 }
370370
371- let app_dir = app_dir. ok_or_else ( || anyhow:: anyhow!( "Usage: forge-host --app-dir <path> [--dev]" ) ) ?;
371+ let app_dir =
372+ app_dir. ok_or_else ( || anyhow:: anyhow!( "Usage: forge-host --app-dir <path> [--dev]" ) ) ?;
372373
373374 let manifest_path = app_dir. join ( "manifest.app.toml" ) ;
374375 let manifest_txt = rt
@@ -423,8 +424,7 @@ fn sync_main(rt: tokio::runtime::Runtime) -> Result<()> {
423424
424425 // Create channels for ext_window (native window operations)
425426 let ( window_cmd_tx, mut window_cmd_rx) = tokio:: sync:: mpsc:: channel :: < WindowCmd > ( 64 ) ;
426- let ( window_events_tx, window_events_rx) =
427- tokio:: sync:: mpsc:: channel :: < WindowSystemEvent > ( 64 ) ;
427+ let ( window_events_tx, window_events_rx) = tokio:: sync:: mpsc:: channel :: < WindowSystemEvent > ( 64 ) ;
428428 let ( window_menu_events_tx, window_menu_events_rx) =
429429 tokio:: sync:: mpsc:: channel :: < WinMenuEvent > ( 64 ) ;
430430
@@ -536,7 +536,10 @@ fn sync_main(rt: tokio::runtime::Runtime) -> Result<()> {
536536
537537 // === ext_window events ===
538538 // Window lifecycle (from host:window)
539- WinCreate ( WindowOpts , tokio:: sync:: oneshot:: Sender < Result < String , String > > ) ,
539+ WinCreate (
540+ WindowOpts ,
541+ tokio:: sync:: oneshot:: Sender < Result < String , String > > ,
542+ ) ,
540543 WinClose ( String , tokio:: sync:: oneshot:: Sender < bool > ) ,
541544 WinMinimize ( String ) ,
542545 WinMaximize ( String ) ,
@@ -546,7 +549,10 @@ fn sync_main(rt: tokio::runtime::Runtime) -> Result<()> {
546549 WinFocus ( String ) ,
547550
548551 // Window properties
549- WinGetPosition ( String , tokio:: sync:: oneshot:: Sender < Result < Position , String > > ) ,
552+ WinGetPosition (
553+ String ,
554+ tokio:: sync:: oneshot:: Sender < Result < Position , String > > ,
555+ ) ,
550556 WinSetPosition ( String , i32 , i32 ) ,
551557 WinGetSize ( String , tokio:: sync:: oneshot:: Sender < Result < Size , String > > ) ,
552558 WinSetSize ( String , u32 , u32 ) ,
@@ -558,24 +564,40 @@ fn sync_main(rt: tokio::runtime::Runtime) -> Result<()> {
558564 WinSetVisible ( String , bool ) ,
559565
560566 // State queries
561- WinGetState ( String , tokio:: sync:: oneshot:: Sender < Result < WinWindowState , String > > ) ,
567+ WinGetState (
568+ String ,
569+ tokio:: sync:: oneshot:: Sender < Result < WinWindowState , String > > ,
570+ ) ,
562571
563572 // Dialogs (from host:window)
564- WinShowOpenDialog ( WinFileDialogOpts , tokio:: sync:: oneshot:: Sender < Option < Vec < String > > > ) ,
565- WinShowSaveDialog ( WinFileDialogOpts , tokio:: sync:: oneshot:: Sender < Option < String > > ) ,
573+ WinShowOpenDialog (
574+ WinFileDialogOpts ,
575+ tokio:: sync:: oneshot:: Sender < Option < Vec < String > > > ,
576+ ) ,
577+ WinShowSaveDialog (
578+ WinFileDialogOpts ,
579+ tokio:: sync:: oneshot:: Sender < Option < String > > ,
580+ ) ,
566581 WinShowMessageDialog ( WinMessageDialogOpts , tokio:: sync:: oneshot:: Sender < usize > ) ,
567582
568583 // Menus (from host:window)
569584 WinSetAppMenu ( Vec < WinMenuItem > , tokio:: sync:: oneshot:: Sender < bool > ) ,
570- WinShowContextMenu ( Option < String > , Vec < WinMenuItem > , tokio:: sync:: oneshot:: Sender < Option < String > > ) ,
585+ WinShowContextMenu (
586+ Option < String > ,
587+ Vec < WinMenuItem > ,
588+ tokio:: sync:: oneshot:: Sender < Option < String > > ,
589+ ) ,
571590
572591 // Tray (from host:window)
573592 WinCreateTray ( WinTrayOpts , tokio:: sync:: oneshot:: Sender < String > ) ,
574593 WinUpdateTray ( String , WinTrayOpts , tokio:: sync:: oneshot:: Sender < bool > ) ,
575594 WinDestroyTray ( String , tokio:: sync:: oneshot:: Sender < bool > ) ,
576595
577596 // Native handle
578- WinGetNativeHandle ( String , tokio:: sync:: oneshot:: Sender < Result < NativeHandle , String > > ) ,
597+ WinGetNativeHandle (
598+ String ,
599+ tokio:: sync:: oneshot:: Sender < Result < NativeHandle , String > > ,
600+ ) ,
579601 }
580602
581603 let event_loop: EventLoop < UserEvent > = EventLoopBuilder :: with_user_event ( ) . build ( ) ;
@@ -680,8 +702,12 @@ fn sync_main(rt: tokio::runtime::Runtime) -> Result<()> {
680702 WindowCmd :: Restore { window_id } => {
681703 let _ = proxy. send_event ( UserEvent :: WinRestore ( window_id) ) ;
682704 }
683- WindowCmd :: SetFullscreen { window_id, fullscreen } => {
684- let _ = proxy. send_event ( UserEvent :: WinSetFullscreen ( window_id, fullscreen) ) ;
705+ WindowCmd :: SetFullscreen {
706+ window_id,
707+ fullscreen,
708+ } => {
709+ let _ =
710+ proxy. send_event ( UserEvent :: WinSetFullscreen ( window_id, fullscreen) ) ;
685711 }
686712 WindowCmd :: Focus { window_id } => {
687713 let _ = proxy. send_event ( UserEvent :: WinFocus ( window_id) ) ;
@@ -697,7 +723,11 @@ fn sync_main(rt: tokio::runtime::Runtime) -> Result<()> {
697723 WindowCmd :: GetSize { window_id, respond } => {
698724 let _ = proxy. send_event ( UserEvent :: WinGetSize ( window_id, respond) ) ;
699725 }
700- WindowCmd :: SetSize { window_id, width, height } => {
726+ WindowCmd :: SetSize {
727+ window_id,
728+ width,
729+ height,
730+ } => {
701731 let _ = proxy. send_event ( UserEvent :: WinSetSize ( window_id, width, height) ) ;
702732 }
703733 WindowCmd :: GetTitle { window_id, respond } => {
@@ -706,14 +736,25 @@ fn sync_main(rt: tokio::runtime::Runtime) -> Result<()> {
706736 WindowCmd :: SetTitle { window_id, title } => {
707737 let _ = proxy. send_event ( UserEvent :: WinSetTitle ( window_id, title) ) ;
708738 }
709- WindowCmd :: SetResizable { window_id, resizable } => {
739+ WindowCmd :: SetResizable {
740+ window_id,
741+ resizable,
742+ } => {
710743 let _ = proxy. send_event ( UserEvent :: WinSetResizable ( window_id, resizable) ) ;
711744 }
712- WindowCmd :: SetDecorations { window_id, decorations } => {
713- let _ = proxy. send_event ( UserEvent :: WinSetDecorations ( window_id, decorations) ) ;
745+ WindowCmd :: SetDecorations {
746+ window_id,
747+ decorations,
748+ } => {
749+ let _ =
750+ proxy. send_event ( UserEvent :: WinSetDecorations ( window_id, decorations) ) ;
714751 }
715- WindowCmd :: SetAlwaysOnTop { window_id, always_on_top } => {
716- let _ = proxy. send_event ( UserEvent :: WinSetAlwaysOnTop ( window_id, always_on_top) ) ;
752+ WindowCmd :: SetAlwaysOnTop {
753+ window_id,
754+ always_on_top,
755+ } => {
756+ let _ = proxy
757+ . send_event ( UserEvent :: WinSetAlwaysOnTop ( window_id, always_on_top) ) ;
717758 }
718759 WindowCmd :: SetVisible { window_id, visible } => {
719760 let _ = proxy. send_event ( UserEvent :: WinSetVisible ( window_id, visible) ) ;
@@ -739,15 +780,24 @@ fn sync_main(rt: tokio::runtime::Runtime) -> Result<()> {
739780 WindowCmd :: SetAppMenu { items, respond } => {
740781 let _ = proxy. send_event ( UserEvent :: WinSetAppMenu ( items, respond) ) ;
741782 }
742- WindowCmd :: ShowContextMenu { window_id, items, respond } => {
743- let _ = proxy. send_event ( UserEvent :: WinShowContextMenu ( window_id, items, respond) ) ;
783+ WindowCmd :: ShowContextMenu {
784+ window_id,
785+ items,
786+ respond,
787+ } => {
788+ let _ = proxy
789+ . send_event ( UserEvent :: WinShowContextMenu ( window_id, items, respond) ) ;
744790 }
745791
746792 // Tray
747793 WindowCmd :: CreateTray { opts, respond } => {
748794 let _ = proxy. send_event ( UserEvent :: WinCreateTray ( opts, respond) ) ;
749795 }
750- WindowCmd :: UpdateTray { tray_id, opts, respond } => {
796+ WindowCmd :: UpdateTray {
797+ tray_id,
798+ opts,
799+ respond,
800+ } => {
751801 let _ = proxy. send_event ( UserEvent :: WinUpdateTray ( tray_id, opts, respond) ) ;
752802 }
753803 WindowCmd :: DestroyTray { tray_id, respond } => {
0 commit comments