From 20a00b80bd3ad251d551f4d4536e5fbfa319563d Mon Sep 17 00:00:00 2001 From: msartore Date: Tue, 6 Feb 2024 21:54:04 +0100 Subject: [PATCH] fix ATA freezing while mirroring screen --- ATA-GUI/ATA-GUI.csproj | 6 +++--- ATA-GUI/Classes/ATA.cs | 2 +- ATA-GUI/Forms/MainForm.cs | 4 ++-- ATA-GUI/Utils/ConsoleProcess.cs | 10 +++++++++- 4 files changed, 15 insertions(+), 7 deletions(-) diff --git a/ATA-GUI/ATA-GUI.csproj b/ATA-GUI/ATA-GUI.csproj index ff8599b..e1ab1d7 100644 --- a/ATA-GUI/ATA-GUI.csproj +++ b/ATA-GUI/ATA-GUI.csproj @@ -9,9 +9,9 @@ ATALogoGUI.ico - 3.4.4.0 - 3.4.4.0 - 3.4.4.0 + 3.4.5.0 + 3.4.5.0 + 3.4.5.0 © 2021-2024 Massimiliano Sartore diff --git a/ATA-GUI/Classes/ATA.cs b/ATA-GUI/Classes/ATA.cs index 595210c..67c68e8 100644 --- a/ATA-GUI/Classes/ATA.cs +++ b/ATA-GUI/Classes/ATA.cs @@ -9,7 +9,7 @@ namespace ATA_GUI.Classes { internal class ATA { - public static readonly string CURRENTVERSION = "v3.4.4"; + public static readonly string CURRENTVERSION = "v3.4.5"; public static readonly string IPFileName = "IPList.txt"; public HashSet IPList { get; } = new HashSet(); diff --git a/ATA-GUI/Forms/MainForm.cs b/ATA-GUI/Forms/MainForm.cs index 0c18d4d..a440fa2 100644 --- a/ATA-GUI/Forms/MainForm.cs +++ b/ATA-GUI/Forms/MainForm.cs @@ -1381,7 +1381,7 @@ private void buttonMobileScreenShare_Click(object sender, EventArgs e) { if (File.Exists("scrcpy.exe")) { - _ = ConsoleProcess.scrcpyProcess("-s " + ATA.CurrentDeviceSelected.ID); + ConsoleProcess.scrcpyProcess("-s " + ATA.CurrentDeviceSelected.ID); } else { @@ -2050,7 +2050,7 @@ private void buttonCamera_Click(object sender, EventArgs e) { if (File.Exists("scrcpy.exe")) { - string[] result = ConsoleProcess.scrcpyProcess("--version").Split(' '); + string[] result = ConsoleProcess.scrcpyVersion("--version").Split(' '); foreach (string item in result) { if (item.Contains(".")) diff --git a/ATA-GUI/Utils/ConsoleProcess.cs b/ATA-GUI/Utils/ConsoleProcess.cs index d471711..aea71b9 100644 --- a/ATA-GUI/Utils/ConsoleProcess.cs +++ b/ATA-GUI/Utils/ConsoleProcess.cs @@ -67,11 +67,19 @@ public static string adbFastbootCommandR(string[] args, int type) return ret.ToString().Trim(); } - public static string scrcpyProcess(string arguments) + public static string scrcpyVersion(string arguments) { return systemProcess("", "scrcpy.exe", arguments); } + public static void scrcpyProcess(string arguments) + { + _ = Task.Run(() => + { + return systemProcess("", "scrcpy.exe", arguments); + }); + } + public static string systemProcess(string command, string exe, string arguments) { Process cmd = new();