@@ -25,7 +25,7 @@ public partial class Main : UIForm
2525 /// <summary>
2626 /// scrcpy版本
2727 /// </summary>
28- public static readonly string ScrcpyVersion = "scrcpy-win64-v2.3.1 " ;
28+ public static readonly string ScrcpyVersion = "scrcpy-win64-v2.4 " ;
2929 /// <summary>
3030 /// scrcpy路径
3131 /// </summary>
@@ -266,6 +266,10 @@ public void InitPdone()
266266 cbxShowTouches . ValueChanged += CommonCbx_ValueChanged ;
267267 cbxReadOnly . ValueChanged += CommonCbx_ValueChanged ;
268268 cbxAudioEnabled . ValueChanged += cbxAudioEnabled_ValueChanged ;
269+
270+ uiLabel4 . DoubleClick += ( sender , e ) => Process . Start ( Logger . path ) ;
271+ uiLabel3 . DoubleClick += ( sender , e ) => Process . Start ( UserDataPath ) ;
272+
269273 #endregion
270274
271275 #region 设置标题和图标
@@ -338,7 +342,7 @@ private void ExtractResource(bool reload = false)
338342 if ( ! Directory . Exists ( ScrcpyPath ) )
339343 {
340344 Directory . CreateDirectory ( ScrcpyPath ) ;
341- File . WriteAllBytes ( ScrcpyPath + tempFileName , Properties . Resources . scrcpy_win64_v2_3_1 ) ;
345+ File . WriteAllBytes ( ScrcpyPath + tempFileName , Properties . Resources . scrcpy_win64_v2_4 ) ;
342346 // 解压缩
343347 ZipFile . ExtractToDirectory ( ScrcpyPath + tempFileName , UserDataPath ) ;
344348 // 解压完成删除压缩包
@@ -404,10 +408,9 @@ private void StartButtonClick(object sender, EventArgs e)
404408 }
405409 // 设置标题
406410 StartParameters . Add ( $ "--window-title \" { Info . ScrcpyTitle } \" ") ;
407- // 设置为文本注入
408- StartParameters . Add ( $ "--prefer-text") ;
409- // 设置为按键注入
410- // StartParameters.Add($"--raw-key-events");
411+ // 设置断开后锁定屏幕
412+ StartParameters . Add ( "--power-off-on-close" ) ;
413+ StartParameters . Add ( _Setting . CustomArgs ) ;
411414 if ( _Setting . AudioEnabled == false ) StartParameters . Add ( _Setting . GetDesc ( "AudioEnabled" ) ) ; // 不转发音频
412415
413416 // 其他参数
@@ -514,14 +517,8 @@ private void RunScrcpy()
514517 }
515518 }
516519 } ;
517- scrcpy . ErrorDataReceived += ( ss , ee ) =>
518- {
519- if ( ee . Data . IsNotNull ( ) )
520- {
521- Logger . Info ( $ "{ ee . Data } ", "scrcpy" ) ;
522- }
523- } ;
524- scrcpy . Exited += ( ss , ee ) =>
520+
521+ void exitHandle ( )
525522 {
526523 SetUserData ( _Setting ) ; // 关闭scrcpy后保存一下配置文件
527524 if ( _Setting . EnableSwitchIME && _Setting . IME != 0 && _Setting . IMEOrigin . IsNotNull ( ) )
@@ -533,7 +530,20 @@ private void RunScrcpy()
533530 ButtonHandle ( false ) ;
534531 LoadHistoryIPs ( true ) ;
535532 ShowMessage ( I18n . msgExit ) ;
533+ }
534+
535+ scrcpy . ErrorDataReceived += ( ss , ee ) =>
536+ {
537+ if ( ee . Data . IsNotNull ( ) )
538+ {
539+ Logger . Info ( $ "{ ee . Data } ", "scrcpy" ) ;
540+ if ( ee . Data . Contains ( "ERROR" ) )
541+ {
542+ exitHandle ( ) ;
543+ }
544+ }
536545 } ;
546+ scrcpy . Exited += ( ss , ee ) => exitHandle ( ) ;
537547 scrcpy . BeginErrorReadLine ( ) ;
538548 scrcpy . BeginOutputReadLine ( ) ;
539549
@@ -767,6 +777,9 @@ private void ComboMbps_SelectedValueChanged(object sender, EventArgs e)
767777 case 5 :
768778 _Setting . BitRate = "-b 4M" ;
769779 break ;
780+ case 6 :
781+ _Setting . BitRate = "-b 1M" ;
782+ break ;
770783 default :
771784 _Setting . BitRate = "" ;
772785 break ;
0 commit comments