File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -698,9 +698,13 @@ impl BackendManager {
698698 log:: info!( "🛑 使用 taskkill 强制终止进程树 (PID={})..." , pid) ;
699699
700700 // /F 强制终止 /T 包含子进程
701- let kill_result = Command :: new ( "taskkill" )
702- . args ( [ "/F" , "/T" , "/PID" , & pid. to_string ( ) ] )
703- . output ( ) ;
701+ let mut kill_cmd = Command :: new ( "taskkill" ) ;
702+ kill_cmd. args ( [ "/F" , "/T" , "/PID" , & pid. to_string ( ) ] ) ;
703+ #[ cfg( target_os = "windows" ) ]
704+ {
705+ kill_cmd. creation_flags ( windows_subsystem_flag ( ) ) ;
706+ }
707+ let kill_result = kill_cmd. output ( ) ;
704708
705709 match kill_result {
706710 Ok ( output) => {
Original file line number Diff line number Diff line change @@ -49,12 +49,13 @@ pub fn run() {
4949 // 已经在关闭中,直接忽略后续点击
5050 if GRACEFUL_SHUTDOWN_STARTED . swap ( true , Ordering :: SeqCst ) {
5151 api. prevent_close ( ) ;
52+ let _ = window. hide ( ) ;
5253 return ;
5354 }
5455 api. prevent_close ( ) ;
5556
56- // 最小化窗口给用户反馈(关闭正在进行)
57- let _ = window. minimize ( ) ;
57+ // 立即隐藏窗口,避免关闭时出现最小化/弹回的怪异反馈。
58+ let _ = window. hide ( ) ;
5859
5960 let app_handle = window. app_handle ( ) . clone ( ) ;
6061 std:: thread:: spawn ( move || {
You can’t perform that action at this time.
0 commit comments