mirror of
				https://github.com/2dust/v2rayN.git
				synced 2025-10-27 10:40:08 +00:00 
			
		
		
		
	Compare commits
	
		
			4 commits
		
	
	
		
			98613c43ca
			...
			579f47ba0d
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
|   | 579f47ba0d | ||
|   | 24cad87954 | ||
|   | 84d72cd110 | ||
|   | c0cd46a5aa | 
					 8 changed files with 24 additions and 8 deletions
				
			
		
							
								
								
									
										3
									
								
								.gitmodules
									
									
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										3
									
								
								.gitmodules
									
									
									
									
										vendored
									
									
										Normal file
									
								
							|  | @ -0,0 +1,3 @@ | ||||||
|  | [submodule "v2rayN/GlobalHotKeys"] | ||||||
|  | 	path = v2rayN/GlobalHotKeys | ||||||
|  | 	url = https://github.com/2dust/GlobalHotKeys | ||||||
|  | @ -9,9 +9,8 @@ | ||||||
|     <PackageVersion Include="Avalonia.Desktop" Version="11.2.4" /> |     <PackageVersion Include="Avalonia.Desktop" Version="11.2.4" /> | ||||||
|     <PackageVersion Include="Avalonia.Diagnostics" Version="11.2.4" /> |     <PackageVersion Include="Avalonia.Diagnostics" Version="11.2.4" /> | ||||||
|     <PackageVersion Include="Avalonia.ReactiveUI" Version="11.2.4" /> |     <PackageVersion Include="Avalonia.ReactiveUI" Version="11.2.4" /> | ||||||
|     <PackageVersion Include="CliWrap" Version="3.8.0" /> |     <PackageVersion Include="CliWrap" Version="3.8.1" /> | ||||||
|     <PackageVersion Include="Downloader" Version="3.3.3" /> |     <PackageVersion Include="Downloader" Version="3.3.3" /> | ||||||
|     <PackageVersion Include="GlobalHotKeys.Windows" Version="0.1.0" /> |  | ||||||
|     <PackageVersion Include="H.NotifyIcon.Wpf" Version="2.2.0" /> |     <PackageVersion Include="H.NotifyIcon.Wpf" Version="2.2.0" /> | ||||||
|     <PackageVersion Include="MaterialDesignThemes" Version="5.2.1" /> |     <PackageVersion Include="MaterialDesignThemes" Version="5.2.1" /> | ||||||
|     <PackageVersion Include="MessageBox.Avalonia" Version="3.2.0" /> |     <PackageVersion Include="MessageBox.Avalonia" Version="3.2.0" /> | ||||||
|  | @ -23,7 +22,7 @@ | ||||||
|     <PackageVersion Include="Semi.Avalonia.DataGrid" Version="11.2.1.4" /> |     <PackageVersion Include="Semi.Avalonia.DataGrid" Version="11.2.1.4" /> | ||||||
|     <PackageVersion Include="Splat.NLog" Version="15.3.1" /> |     <PackageVersion Include="Splat.NLog" Version="15.3.1" /> | ||||||
|     <PackageVersion Include="sqlite-net-pcl" Version="1.9.172" /> |     <PackageVersion Include="sqlite-net-pcl" Version="1.9.172" /> | ||||||
|     <PackageVersion Include="TaskScheduler" Version="2.11.0" /> |     <PackageVersion Include="TaskScheduler" Version="2.12.0" /> | ||||||
|     <PackageVersion Include="WebDav.Client" Version="2.8.0" /> |     <PackageVersion Include="WebDav.Client" Version="2.8.0" /> | ||||||
|     <PackageVersion Include="YamlDotNet" Version="16.3.0" /> |     <PackageVersion Include="YamlDotNet" Version="16.3.0" /> | ||||||
|     <PackageVersion Include="ZXing.Net.Bindings.SkiaSharp" Version="0.16.14" /> |     <PackageVersion Include="ZXing.Net.Bindings.SkiaSharp" Version="0.16.14" /> | ||||||
|  |  | ||||||
							
								
								
									
										1
									
								
								v2rayN/GlobalHotKeys
									
									
									
									
									
										Submodule
									
								
							
							
						
						
									
										1
									
								
								v2rayN/GlobalHotKeys
									
									
									
									
									
										Submodule
									
								
							|  | @ -0,0 +1 @@ | ||||||
|  | Subproject commit 35901e2eaa40bc697e3864cb63812fb355af4087 | ||||||
|  | @ -20,9 +20,13 @@ public static class ProcUtils | ||||||
|         try |         try | ||||||
|         { |         { | ||||||
|             if (fileName.Contains(' ')) |             if (fileName.Contains(' ')) | ||||||
|  |             { | ||||||
|                 fileName = fileName.AppendQuotes(); |                 fileName = fileName.AppendQuotes(); | ||||||
|  |             } | ||||||
|             if (arguments.Contains(' ')) |             if (arguments.Contains(' ')) | ||||||
|  |             { | ||||||
|                 arguments = arguments.AppendQuotes(); |                 arguments = arguments.AppendQuotes(); | ||||||
|  |             } | ||||||
| 
 | 
 | ||||||
|             Process proc = new() |             Process proc = new() | ||||||
|             { |             { | ||||||
|  |  | ||||||
|  | @ -253,7 +253,7 @@ namespace ServiceLib.Handler | ||||||
|                     StartInfo = new() |                     StartInfo = new() | ||||||
|                     { |                     { | ||||||
|                         FileName = fileName, |                         FileName = fileName, | ||||||
|                         Arguments = string.Format(coreInfo.Arguments, coreInfo.AbsolutePath ? Utils.GetBinConfigPath(configPath) : configPath), |                         Arguments = string.Format(coreInfo.Arguments, coreInfo.AbsolutePath ? Utils.GetBinConfigPath(configPath).AppendQuotes() : configPath), | ||||||
|                         WorkingDirectory = Utils.GetBinConfigPath(), |                         WorkingDirectory = Utils.GetBinConfigPath(), | ||||||
|                         UseShellExecute = false, |                         UseShellExecute = false, | ||||||
|                         RedirectStandardOutput = displayLog, |                         RedirectStandardOutput = displayLog, | ||||||
|  |  | ||||||
|  | @ -3,7 +3,6 @@ using Avalonia.Input; | ||||||
| using Avalonia.ReactiveUI; | using Avalonia.ReactiveUI; | ||||||
| using Avalonia.Win32.Input; | using Avalonia.Win32.Input; | ||||||
| using GlobalHotKeys; | using GlobalHotKeys; | ||||||
| using GlobalHotKeys.Native.Types; |  | ||||||
| 
 | 
 | ||||||
| namespace v2rayN.Desktop.Handler | namespace v2rayN.Desktop.Handler | ||||||
| { | { | ||||||
|  | @ -24,7 +23,6 @@ namespace v2rayN.Desktop.Handler | ||||||
|         { |         { | ||||||
|             _config = config; |             _config = config; | ||||||
|             _updateFunc = updateFunc; |             _updateFunc = updateFunc; | ||||||
|             _hotKeyManager = new GlobalHotKeys.HotKeyManager(); |  | ||||||
| 
 | 
 | ||||||
|             Register(); |             Register(); | ||||||
|         } |         } | ||||||
|  | @ -36,6 +34,11 @@ namespace v2rayN.Desktop.Handler | ||||||
| 
 | 
 | ||||||
|         private void Register() |         private void Register() | ||||||
|         { |         { | ||||||
|  |             if (_config.GlobalHotkeys.Any(t => t.KeyCode > 0) == false) | ||||||
|  |             { | ||||||
|  |                 return; | ||||||
|  |             } | ||||||
|  |             _hotKeyManager ??= new GlobalHotKeys.HotKeyManager(); | ||||||
|             _hotkeyTriggerDic.Clear(); |             _hotkeyTriggerDic.Clear(); | ||||||
| 
 | 
 | ||||||
|             foreach (var item in _config.GlobalHotkeys) |             foreach (var item in _config.GlobalHotkeys) | ||||||
|  |  | ||||||
|  | @ -26,12 +26,12 @@ | ||||||
| 		<PackageReference Include="ReactiveUI.Fody"> | 		<PackageReference Include="ReactiveUI.Fody"> | ||||||
| 			<TreatAsUsed>true</TreatAsUsed> | 			<TreatAsUsed>true</TreatAsUsed> | ||||||
| 		</PackageReference> | 		</PackageReference> | ||||||
|         <PackageReference Include="GlobalHotKeys.Windows" /> |  | ||||||
| 	</ItemGroup> | 	</ItemGroup> | ||||||
| 
 | 
 | ||||||
| 	<ItemGroup> | 	<ItemGroup> | ||||||
| 		<ProjectCapability Include="Avalonia" /> | 		<ProjectCapability Include="Avalonia" /> | ||||||
| 		<AvaloniaResource Include="Assets\**" /> | 		<AvaloniaResource Include="Assets\**" /> | ||||||
|  | 		<ProjectReference Include="..\GlobalHotKeys\src\GlobalHotKeys\GlobalHotKeys.csproj" /> | ||||||
| 		<ProjectReference Include="..\ServiceLib\ServiceLib.csproj" /> | 		<ProjectReference Include="..\ServiceLib\ServiceLib.csproj" /> | ||||||
| 	</ItemGroup> | 	</ItemGroup> | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
|  | @ -11,6 +11,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "v2rayN.Desktop", "v2rayN.De | ||||||
| EndProject | EndProject | ||||||
| Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AmazTool", "AmazTool\AmazTool.csproj", "{47D68B1C-601C-4C69-873B-FFF0DC13EC97}" | Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AmazTool", "AmazTool\AmazTool.csproj", "{47D68B1C-601C-4C69-873B-FFF0DC13EC97}" | ||||||
| EndProject | EndProject | ||||||
|  | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GlobalHotKeys", "GlobalHotKeys\src\GlobalHotKeys\GlobalHotKeys.csproj", "{CB3DE54F-3A26-AE02-1299-311132C32156}" | ||||||
|  | EndProject | ||||||
| Global | Global | ||||||
| 	GlobalSection(SolutionConfigurationPlatforms) = preSolution | 	GlobalSection(SolutionConfigurationPlatforms) = preSolution | ||||||
| 		Debug|Any CPU = Debug|Any CPU | 		Debug|Any CPU = Debug|Any CPU | ||||||
|  | @ -33,6 +35,10 @@ Global | ||||||
| 		{47D68B1C-601C-4C69-873B-FFF0DC13EC97}.Debug|Any CPU.Build.0 = Debug|Any CPU | 		{47D68B1C-601C-4C69-873B-FFF0DC13EC97}.Debug|Any CPU.Build.0 = Debug|Any CPU | ||||||
| 		{47D68B1C-601C-4C69-873B-FFF0DC13EC97}.Release|Any CPU.ActiveCfg = Release|Any CPU | 		{47D68B1C-601C-4C69-873B-FFF0DC13EC97}.Release|Any CPU.ActiveCfg = Release|Any CPU | ||||||
| 		{47D68B1C-601C-4C69-873B-FFF0DC13EC97}.Release|Any CPU.Build.0 = Release|Any CPU | 		{47D68B1C-601C-4C69-873B-FFF0DC13EC97}.Release|Any CPU.Build.0 = Release|Any CPU | ||||||
|  | 		{CB3DE54F-3A26-AE02-1299-311132C32156}.Debug|Any CPU.ActiveCfg = Debug|Any CPU | ||||||
|  | 		{CB3DE54F-3A26-AE02-1299-311132C32156}.Debug|Any CPU.Build.0 = Debug|Any CPU | ||||||
|  | 		{CB3DE54F-3A26-AE02-1299-311132C32156}.Release|Any CPU.ActiveCfg = Release|Any CPU | ||||||
|  | 		{CB3DE54F-3A26-AE02-1299-311132C32156}.Release|Any CPU.Build.0 = Release|Any CPU | ||||||
| 	EndGlobalSection | 	EndGlobalSection | ||||||
| 	GlobalSection(SolutionProperties) = preSolution | 	GlobalSection(SolutionProperties) = preSolution | ||||||
| 		HideSolutionNode = FALSE | 		HideSolutionNode = FALSE | ||||||
|  |  | ||||||
		Loading…
	
		Reference in a new issue