diff --git a/.github/PublishAllPlatforms.ps1 b/.github/PublishAllPlatforms.ps1 index c46c243f..cf782334 100644 --- a/.github/PublishAllPlatforms.ps1 +++ b/.github/PublishAllPlatforms.ps1 @@ -59,8 +59,8 @@ Compress-Archive -Path "..\SQRLDotNetClientUI\bin\Release\netcoreapp3.1\win-x64\ #Copying Platform Aware Installer (binary) to Publishing Folder -Copy-Item ".\bin\Release\netcoreapp3.1\osx-x64\publish\SQRLPlatformAwareInstaller_osx" -Destination "C:\Temp\SQRL\Publish\" -Force -Copy-Item ".\bin\Release\netcoreapp3.1\linux-x64\publish\SQRLPlatformAwareInstaller_linux" -Destination "C:\Temp\SQRL\Publish\" -Force +tar -cvzf C:\Temp\SQRL\Publish\SQRLPlatformAwareInstaller_osx.tar.gz -C .\bin\Release\netcoreapp3.1\osx-x64\publish\ ./SQRLPlatformAwareInstaller_osx +tar -cvzf C:\Temp\SQRL\Publish\SQRLPlatformAwareInstaller_linux.tar.gz -C .\bin\Release\netcoreapp3.1\linux-x64\publish\ ./SQRLPlatformAwareInstaller_linux Copy-Item ".\bin\Release\netcoreapp3.1\win-x64\publish\SQRLPlatformAwareInstaller_win.exe" -Destination "C:\Temp\SQRL\Publish\" -Force echo "Creating Github Release for Milestone: $milestone" @@ -95,7 +95,7 @@ $jsonObject = ConvertFrom-Json $([String]::new($newRelease.Content)) Get-ChildItem "C:\Temp\SQRL\Publish"| #For each file in the publishing folder upload the asset Foreach-Object { - $contentType = If ($_.Extension -eq ".zip") {"application/x-zip-compressed"} else {"application/octet-stream"} + $contentType = If ($_.Extension -eq ".zip") {"application/application/x-gzip"} If ($_.Extension -eq ".gz") {"application/x-gzip"} else {"application/octet-stream"} $fileHeaders = @{ "Accept"="application/vnd.github.v3+json" "Authorization"="token $token" diff --git a/SQRLDotNetClientUI/Platform/OSX/AppDelegate.cs b/SQRLDotNetClientUI/Platform/OSX/AppDelegate.cs index dd34e839..1e4297ff 100644 --- a/SQRLDotNetClientUI/Platform/OSX/AppDelegate.cs +++ b/SQRLDotNetClientUI/Platform/OSX/AppDelegate.cs @@ -116,7 +116,6 @@ private void HandleOpenURL(NSAppleEventDescriptor evt, NSAppleEventDescriptor re (Application.Current as App).RestoreMainWindow(); }); } - } } @@ -124,9 +123,38 @@ private void HandleOpenURL(NSAppleEventDescriptor evt, NSAppleEventDescriptor re } + /// + /// Because we are creating our own mac application delegate we are removing / overriding + /// the one that Avalonia creates. This causes the application to not be handled as it should. + /// This is the Avalonia Implementation: https://github.com/AvaloniaUI/Avalonia/blob/5a2ef35dacbce0438b66d9f012e5f629045beb3d/native/Avalonia.Native/src/OSX/app.mm + /// So what we are doing here is re-creating this implementation to mimick their behavior. + /// + /// + public override void WillFinishLaunching(NSNotification notification) + { + + if(NSApplication.SharedApplication.ActivationPolicy != NSApplicationActivationPolicy.Regular) + { + foreach(var x in NSRunningApplication.GetRunningApplications(@"com.apple.dock")) + { + x.Activate(NSApplicationActivationOptions.ActivateIgnoringOtherWindows); + break; + } + NSApplication.SharedApplication.ActivationPolicy = NSApplicationActivationPolicy.Regular; + } + } + + /// + /// Because we are creating our own mac application delegate we are removing / overriding + /// the one that Avalonia creates. This causes the application to not be handled as it should. + /// This is the Avalonia Implementation: https://github.com/AvaloniaUI/Avalonia/blob/5a2ef35dacbce0438b66d9f012e5f629045beb3d/native/Avalonia.Native/src/OSX/app.mm + /// So what we are doing here is re-creating this implementation to mimick their behavior. + /// + /// public override void DidFinishLaunching(NSNotification notification) { - IsFinishedLaunching = true; + + NSRunningApplication.CurrentApplication.Activate(NSApplicationActivationOptions.ActivateIgnoringOtherWindows); }