Compare commits

...

3 commits

Author SHA1 Message Date
ShiinaRinne
f71125d8f3
macOS 一些优化 (#6596)
Some checks are pending
release Linux / build (Release) (push) Waiting to run
release macOS / build (Release) (push) Waiting to run
release Windows desktop (Avalonia UI) / build (Release) (push) Waiting to run
release Windows / build (Release) (push) Waiting to run
* [macOS] hide icon in Dock

* [macOS] fix: close button not work

* [macOS] fix: cant directly show window when click `Show or hide the main window` on minimized
2025-01-29 19:26:40 +08:00
2dust
e674a025d8 Adjust Directory.Build.props
https://learn.microsoft.com/zh-cn/dotnet/core/deploying/trimming/trimming-options

https://learn.microsoft.com/zh-cn/dotnet/csharp/language-reference/compiler-options/code-generation
2025-01-29 15:17:30 +08:00
2dust
dadc24876f Change Directory 2025-01-29 14:22:30 +08:00
6 changed files with 62 additions and 91 deletions

View file

@ -1,65 +0,0 @@
<Project>
<PropertyGroup>
<Version>7.7.0</Version>
</PropertyGroup>
<PropertyGroup>
<CheckForOverflowUnderflow>true</CheckForOverflowUnderflow>
<ErrorReport>none</ErrorReport>
<NoWarn>CA1031;CS1591;NU1507</NoWarn>
<Nullable>annotations</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
<AnalysisLevel>latest-all</AnalysisLevel>
<Authors>2dust</Authors>
<Company>2dust</Company>
<PackageLicenseExpression>GPL-3.0</PackageLicenseExpression>
<PackageReadmeFile>README.md</PackageReadmeFile>
<Copyright>Copyright © 2017-$([System.DateTime]::UtcNow.Year) $(Company)</Copyright>
<Description>A GUI client for Windows, Linux and macOS, supports Xray, sing-box and others.</Description>
<RepositoryType>Git</RepositoryType>
<RepositoryBranch>master</RepositoryBranch>
<RepositoryUrl>$(PackageProjectUrl).git</RepositoryUrl>
<PackageProjectUrl>https://github.com/$(Company)/v2rayN</PackageProjectUrl>
<PackageReleaseNotes>$(PackageProjectUrl)/releases</PackageReleaseNotes>
<TargetFramework>net8.0-windows10.0.17763</TargetFramework>
<EnableWindowsTargeting>true</EnableWindowsTargeting>
<RollForward>latestMinor</RollForward>
<TargetLatestRuntimePatch>true</TargetLatestRuntimePatch>
<SupportedOSPlatformVersion>7.0</SupportedOSPlatformVersion>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)' == 'Debug'">
<DebugType>embedded</DebugType>
<Optimize>false</Optimize>
<InvariantGlobalization>false</InvariantGlobalization>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)' == 'Release'">
<DebuggerSupport>false</DebuggerSupport>
<DebugSymbols>false</DebugSymbols>
<DebugType>none</DebugType>
<Optimize>true</Optimize>
<EventSourceSupport>false</EventSourceSupport>
<StackTraceSupport>false</StackTraceSupport>
<MetricsSupport>false</MetricsSupport>
<HttpActivityPropagationSupport>false</HttpActivityPropagationSupport>
<MetadataUpdaterSupport>false</MetadataUpdaterSupport>
<EnableUnsafeBinaryFormatterSerialization>false</EnableUnsafeBinaryFormatterSerialization>
<EnableUnsafeUTF7Encoding>false</EnableUnsafeUTF7Encoding>
<UseNativeHttpHandler>true</UseNativeHttpHandler>
<AutoreleasePoolSupport>false</AutoreleasePoolSupport>
<InvariantGlobalization>false</InvariantGlobalization>
<UseSystemResourceKeys>true</UseSystemResourceKeys>
<PublishTrimmed>false</PublishTrimmed>
<PublishReadyToRun>false</PublishReadyToRun>
<PublishSingleFile>true</PublishSingleFile>
<IncludeNativeLibrariesForSelfExtract>true</IncludeNativeLibrariesForSelfExtract>
</PropertyGroup>
</Project>

View file

@ -0,0 +1,32 @@
<Project>
<PropertyGroup>
<Version>7.7.0</Version>
</PropertyGroup>
<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<TargetLatestRuntimePatch>true</TargetLatestRuntimePatch>
<CheckForOverflowUnderflow>true</CheckForOverflowUnderflow>
<NoWarn>CA1031;CS1591;NU1507</NoWarn>
<Nullable>annotations</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
<Authors>2dust</Authors>
<PackageLicenseExpression>GPL-3.0</PackageLicenseExpression>
<Copyright>Copyright © 2017-$([System.DateTime]::UtcNow.Year) $(Authors)</Copyright>
<InvariantGlobalization>false</InvariantGlobalization>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)' == 'Release'">
<EventSourceSupport>false</EventSourceSupport>
<StackTraceSupport>false</StackTraceSupport>
<MetricsSupport>false</MetricsSupport>
<MetadataUpdaterSupport>false</MetadataUpdaterSupport>
<EnableUnsafeBinaryFormatterSerialization>false</EnableUnsafeBinaryFormatterSerialization>
<EnableUnsafeUTF7Encoding>false</EnableUnsafeUTF7Encoding>
<UseSystemResourceKeys>true</UseSystemResourceKeys>
<PublishSingleFile>true</PublishSingleFile>
<IncludeNativeLibrariesForSelfExtract>true</IncludeNativeLibrariesForSelfExtract>
</PropertyGroup>
</Project>

View file

@ -52,5 +52,6 @@ internal class Program
//.WithInterFont()
.WithFontByDefault()
.LogToTrace()
.UseReactiveUI();
.UseReactiveUI()
.With(new MacOSPlatformOptions { ShowInDock = false});
}

View file

@ -390,6 +390,7 @@ namespace v2rayN.Desktop.Views
StorageUI();
await ViewModel?.MyAppExitAsync(false);
Close();
}
#endregion Event
@ -398,7 +399,7 @@ namespace v2rayN.Desktop.Views
public void ShowHideWindow(bool? blShow)
{
var bl = blShow ?? !_config.UiItem.ShowInTaskbar;
var bl = blShow ?? (!_config.UiItem.ShowInTaskbar ^ (WindowState==WindowState.Minimized));
if (bl)
{
this.Show();
@ -411,7 +412,7 @@ namespace v2rayN.Desktop.Views
}
else
{
if (_config.UiItem.Hide2TrayWhenClose)
if (Utils.IsOSX() || _config.UiItem.Hide2TrayWhenClose)
{
this.Hide();
}

View file

@ -1,11 +1,13 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<GenerateSatelliteAssembliesForCore>true</GenerateSatelliteAssembliesForCore>
<OutputType>WinExe</OutputType>
<TargetFramework>net8.0-windows10.0.17763</TargetFramework>
<GenerateSatelliteAssembliesForCore>true</GenerateSatelliteAssembliesForCore>
<UseWPF>true</UseWPF>
<ApplicationIcon>Resources\v2rayN.ico</ApplicationIcon>
<ApplicationManifest>app.manifest</ApplicationManifest>
<SupportedOSPlatformVersion>7.0</SupportedOSPlatformVersion>
</PropertyGroup>
<ItemGroup>