Browse Source

MacOs stuff and runtime identifier

flabbet 1 year ago
parent
commit
ea67c8ce9d

+ 1 - 1
src/PixiEditor.AvaloniaUI/Initialization/ClassicDesktopEntry.cs

@@ -123,7 +123,7 @@ internal class ClassicDesktopEntry
 #elif LINUX
 #elif LINUX
         return new PixiEditor.Linux.LinuxOperatingSystem();
         return new PixiEditor.Linux.LinuxOperatingSystem();
 #elif MACOS
 #elif MACOS
-        return new PixiEditor.MacOs.MacOSOperatingSystem();
+        return new PixiEditor.MacOs.MacOperatingSystem();
 #else
 #else
         throw new PlatformNotSupportedException("This platform is not supported");
         throw new PlatformNotSupportedException("This platform is not supported");
 #endif
 #endif

+ 14 - 5
src/PixiEditor.AvaloniaUI/PixiEditor.AvaloniaUI.csproj

@@ -23,15 +23,24 @@
     <DebugType>None</DebugType>
     <DebugType>None</DebugType>
   </PropertyGroup>
   </PropertyGroup>
 
 
-  <PropertyGroup Condition="'$(OS)' == 'Windows_NT'">
+  <PropertyGroup Condition="$([MSBuild]::IsOsPlatform('Windows')) AND '$([System.Runtime.InteropServices.RuntimeInformation]::OSArchitecture)' == 'X64'">
     <RuntimeIdentifier>win-x64</RuntimeIdentifier>
     <RuntimeIdentifier>win-x64</RuntimeIdentifier>
   </PropertyGroup>
   </PropertyGroup>
-  <PropertyGroup Condition="$([System.Runtime.InteropServices.RuntimeInformation]::IsOSPlatform($([System.Runtime.InteropServices.OSPlatform]::Linux)))">
+  <PropertyGroup Condition="$([MSBuild]::IsOsPlatform('Windows')) AND '$([System.Runtime.InteropServices.RuntimeInformation]::OSArchitecture)' == 'Arm64'">
+    <RuntimeIdentifier>win-arm64</RuntimeIdentifier>
+  </PropertyGroup>
+  <PropertyGroup Condition="$([MSBuild]::IsOsPlatform('Linux')) AND '$([System.Runtime.InteropServices.RuntimeInformation]::OSArchitecture)' == 'X64'">
     <RuntimeIdentifier>linux-x64</RuntimeIdentifier>
     <RuntimeIdentifier>linux-x64</RuntimeIdentifier>
   </PropertyGroup>
   </PropertyGroup>
-  <PropertyGroup Condition="$([System.Runtime.InteropServices.RuntimeInformation]::IsOSPlatform($([System.Runtime.InteropServices.OSPlatform]::OSX)))">
+  <PropertyGroup Condition="$([MSBuild]::IsOsPlatform('Linux')) AND '$([System.Runtime.InteropServices.RuntimeInformation]::OSArchitecture)' == 'Arm64'">
+    <RuntimeIdentifier>linux-arm64</RuntimeIdentifier>
+  </PropertyGroup>
+  <PropertyGroup Condition="$([MSBuild]::IsOsPlatform('OSX')) AND '$([System.Runtime.InteropServices.RuntimeInformation]::OSArchitecture)' == 'X64'">
     <RuntimeIdentifier>osx-x64</RuntimeIdentifier>
     <RuntimeIdentifier>osx-x64</RuntimeIdentifier>
   </PropertyGroup>
   </PropertyGroup>
+  <PropertyGroup Condition="$([MSBuild]::IsOsPlatform('OSX')) AND '$([System.Runtime.InteropServices.RuntimeInformation]::OSArchitecture)' == 'Arm64'">
+    <RuntimeIdentifier>osx-arm64</RuntimeIdentifier>
+  </PropertyGroup>
 
 
   <PropertyGroup Condition="'$(Platform)'=='x64'">
   <PropertyGroup Condition="'$(Platform)'=='x64'">
     <TargetPlatform>x64</TargetPlatform>
     <TargetPlatform>x64</TargetPlatform>
@@ -113,7 +122,7 @@
   </PropertyGroup>
   </PropertyGroup>
   
   
   <ItemGroup Condition="'$(RuntimeIdentifier)'=='osx-x64'">
   <ItemGroup Condition="'$(RuntimeIdentifier)'=='osx-x64'">
-    <ProjectReference Include="..\PixiEditor.Mac\PixiEditor.MacOs.csproj"/>
+    <ProjectReference Include="..\PixiEditor.MacOs\PixiEditor.MacOs.csproj"/>
   </ItemGroup>
   </ItemGroup>
   
   
   <PropertyGroup Condition="'$(RuntimeIdentifier)'=='osx-x64'">
   <PropertyGroup Condition="'$(RuntimeIdentifier)'=='osx-x64'">
@@ -121,7 +130,7 @@
   </PropertyGroup>
   </PropertyGroup>
   
   
   <ItemGroup Condition="'$(RuntimeIdentifier)'=='osx-arm64'">
   <ItemGroup Condition="'$(RuntimeIdentifier)'=='osx-arm64'">
-    <ProjectReference Include="..\PixiEditor.Mac\PixiEditor.MacOs.csproj"/>
+    <ProjectReference Include="..\PixiEditor.MacOs\PixiEditor.MacOs.csproj"/>
   </ItemGroup>
   </ItemGroup>
   
   
   <PropertyGroup Condition="'$(RuntimeIdentifier)'=='osx-arm64'">
   <PropertyGroup Condition="'$(RuntimeIdentifier)'=='osx-arm64'">

+ 1 - 1
src/PixiEditor.AvaloniaUI/Views/Overlays/SelectionOverlay/SelectionOverlay.cs

@@ -114,7 +114,7 @@ internal class SelectionOverlay : Overlay
     private static void OnPathChanged(AvaloniaPropertyChangedEventArgs<VectorPath?> args)
     private static void OnPathChanged(AvaloniaPropertyChangedEventArgs<VectorPath?> args)
     {
     {
         var self = (SelectionOverlay)args.Sender;
         var self = (SelectionOverlay)args.Sender;
-        if (args.NewValue.HasValue && !args.NewValue.Value.IsEmpty && self.IsVisible)
+        if (args.NewValue is { HasValue: true, Value.IsEmpty: false } && self.IsVisible)
         {
         {
             self.cancelAnimationToken = new CancellationTokenSource();
             self.cancelAnimationToken = new CancellationTokenSource();
             self.animation.RunAsync(self, self.cancelAnimationToken.Token);
             self.animation.RunAsync(self, self.cancelAnimationToken.Token);

+ 1 - 1
src/PixiEditor.MacOs/MacOperatingSystem.cs

@@ -21,6 +21,6 @@ public sealed class MacOperatingSystem : IOperatingSystem
 
 
     public bool HandleNewInstance(Dispatcher? dispatcher, Action<string> openInExistingAction, IApplicationLifetime lifetime)
     public bool HandleNewInstance(Dispatcher? dispatcher, Action<string> openInExistingAction, IApplicationLifetime lifetime)
     {
     {
-        throw new NotImplementedException();
+        return true;
     }
     }
 }
 }