Skip to content

Commit

Permalink
Cherrypick fron net7 to release branch (#10957)
Browse files Browse the repository at this point in the history
* Squashed commit of the following: (#10942)

commit 22b3033
Merge: 50866a7 95ee1a3
Author: Matthew Leibowitz <[email protected]>
Date:   Thu Oct 27 11:10:47 2022 +0200

    Merge branch 'net7.0' into darc-net7.0-45fa6a48-68f2-4992-95f2-e40e8e14afd5

commit 50866a7
Author: Jonathan Dick <[email protected]>
Date:   Wed Oct 26 21:22:02 2022 -0400

    Bump net6 version for SR7

commit 8edadd3
Author: Rui Marinho <[email protected]>
Date:   Wed Oct 26 18:55:17 2022 +0100

    Update NuGet.config

commit b7c5411
Author: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
Date:   Wed Oct 26 17:48:49 2022 +0000

    Update dependencies from https://github.com/xamarin/xamarin-macios build 20221026.24

    Microsoft.tvOS.Sdk
     From Version 16.0.1475 -> To Version 16.0.1477

commit 4c57036
Author: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
Date:   Wed Oct 26 17:48:09 2022 +0000

    Update dependencies from https://github.com/xamarin/xamarin-macios build 20221026.24

    Microsoft.iOS.Sdk
     From Version 16.0.1475 -> To Version 16.0.1477

commit 89f722e
Author: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
Date:   Wed Oct 26 16:51:31 2022 +0000

    Update dependencies from https://github.com/xamarin/xamarin-macios build 20221026.21

    Microsoft.tvOS.Sdk
     From Version 16.0.1475 -> To Version 16.0.1476

commit 9dc4a41
Author: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
Date:   Wed Oct 26 16:51:01 2022 +0000

    Update dependencies from https://github.com/xamarin/xamarin-macios build 20221026.21

    Microsoft.iOS.Sdk
     From Version 16.0.1475 -> To Version 16.0.1476

commit dde2135
Author: Rui Marinho <[email protected]>
Date:   Wed Oct 26 17:46:35 2022 +0100

    Add Nuget.config feed

commit bad3509
Author: GitHub Actions Autoformatter <[email protected]>
Date:   Wed Oct 26 16:41:26 2022 +0000

    Auto-format source code

commit 6d56d6c
Author: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
Date:   Wed Oct 26 16:40:27 2022 +0000

    Update dependencies from https://github.com/xamarin/xamarin-macios build 20221026.22

    Microsoft.MacCatalyst.Sdk
     From Version 15.4.2370 -> To Version 15.4.2371

commit 2da2d4d
Author: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
Date:   Wed Oct 26 16:40:10 2022 +0000

    Update dependencies from https://github.com/xamarin/xamarin-macios build 20221026.22

    Microsoft.macOS.Sdk
     From Version 12.3.2370 -> To Version 12.3.2371

Co-authored-by: Matthew Leibowitz <[email protected]>
# Conflicts:
#	eng/Version.Details.xml
#	eng/Versions.props

* Dispose empty sets and try/catch exceptions (#10955)

Workaround for xamarin/xamarin-macios#13704

* Update MAUI's net6 version

Co-authored-by: dotnet-maestro[bot] <42748379+dotnet-maestro[bot]@users.noreply.github.com>
Co-authored-by: Matthew Leibowitz <[email protected]>
Co-authored-by: Jonathan Dick <[email protected]>
  • Loading branch information
4 people authored Oct 27, 2022
1 parent 871aeef commit a99302b
Show file tree
Hide file tree
Showing 4 changed files with 52 additions and 24 deletions.
16 changes: 8 additions & 8 deletions eng/Version.Details.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,21 +12,21 @@
<Uri>https://github.com/xamarin/xamarin-android</Uri>
<Sha>8f1d9a47205ead80132661f68b0cee9ed0e0220b</Sha>
</Dependency>
<Dependency Name="Microsoft.MacCatalyst.Sdk" Version="15.4.2367">
<Dependency Name="Microsoft.MacCatalyst.Sdk" Version="15.4.2371">
<Uri>https://github.com/xamarin/xamarin-macios</Uri>
<Sha>42be8a5bba623032464c79823ebf4a187dd656fd</Sha>
<Sha>efd24e1e4f4b92c8d4a098c90c7dabcc053f9f32</Sha>
</Dependency>
<Dependency Name="Microsoft.macOS.Sdk" Version="12.3.2367">
<Dependency Name="Microsoft.macOS.Sdk" Version="12.3.2371">
<Uri>https://github.com/xamarin/xamarin-macios</Uri>
<Sha>42be8a5bba623032464c79823ebf4a187dd656fd</Sha>
<Sha>efd24e1e4f4b92c8d4a098c90c7dabcc053f9f32</Sha>
</Dependency>
<Dependency Name="Microsoft.iOS.Sdk" Version="16.0.1472">
<Dependency Name="Microsoft.iOS.Sdk" Version="16.0.1477">
<Uri>https://github.com/xamarin/xamarin-macios</Uri>
<Sha>4876d7bea50e2258f4167b07eabbcd88129ff171</Sha>
<Sha>4402959f7d048f253a627915131ea2219bdba2fc</Sha>
</Dependency>
<Dependency Name="Microsoft.tvOS.Sdk" Version="16.0.1472">
<Dependency Name="Microsoft.tvOS.Sdk" Version="16.0.1477">
<Uri>https://github.com/xamarin/xamarin-macios</Uri>
<Sha>4876d7bea50e2258f4167b07eabbcd88129ff171</Sha>
<Sha>4402959f7d048f253a627915131ea2219bdba2fc</Sha>
</Dependency>
<Dependency Name="Microsoft.NET.Workload.Emscripten.net6.Manifest-7.0.100" Version="7.0.0-rtm.22504.3" CoherentParentDependency="Microsoft.NETCore.App.Ref">
<Uri>https://github.com/dotnet/emsdk</Uri>
Expand Down
10 changes: 5 additions & 5 deletions eng/Versions.props
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project>
<PropertyGroup>
<!-- Current previous .NET SDK major version's stable release of MAUI packages -->
<MicrosoftMauiPreviousDotNetReleasedVersion>6.0.545</MicrosoftMauiPreviousDotNetReleasedVersion>
<MicrosoftMauiPreviousDotNetReleasedVersion>6.0.547</MicrosoftMauiPreviousDotNetReleasedVersion>
<!-- dotnet/installer -->
<MicrosoftDotnetSdkInternalPackageVersion>7.0.100-rtm.22519.39</MicrosoftDotnetSdkInternalPackageVersion>
<!-- dotnet/runtime -->
Expand All @@ -13,10 +13,10 @@
<!-- xamarin/xamarin-android -->
<MicrosoftAndroidSdkWindowsPackageVersion>33.0.4</MicrosoftAndroidSdkWindowsPackageVersion>
<!-- xamarin/xamarin-macios -->
<MicrosoftMacCatalystSdkPackageVersion>15.4.2367</MicrosoftMacCatalystSdkPackageVersion>
<MicrosoftmacOSSdkPackageVersion>12.3.2367</MicrosoftmacOSSdkPackageVersion>
<MicrosoftiOSSdkPackageVersion>16.0.1472</MicrosoftiOSSdkPackageVersion>
<MicrosofttvOSSdkPackageVersion>16.0.1472</MicrosofttvOSSdkPackageVersion>
<MicrosoftMacCatalystSdkPackageVersion>15.4.2371</MicrosoftMacCatalystSdkPackageVersion>
<MicrosoftmacOSSdkPackageVersion>12.3.2371</MicrosoftmacOSSdkPackageVersion>
<MicrosoftiOSSdkPackageVersion>16.0.1477</MicrosoftiOSSdkPackageVersion>
<MicrosofttvOSSdkPackageVersion>16.0.1477</MicrosofttvOSSdkPackageVersion>
<!-- Samsung/Tizen.NET -->
<SamsungTizenSdkPackageVersion>7.0.100</SamsungTizenSdkPackageVersion>
<!-- emsdk -->
Expand Down
20 changes: 15 additions & 5 deletions src/Core/src/Platform/iOS/ApplicationExtensions.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System.Collections.Generic;
using System;
using System.Collections.Generic;
using System.Runtime.Versioning;
using Foundation;
using Microsoft.Extensions.Logging;
Expand Down Expand Up @@ -57,14 +58,23 @@ public static void CreatePlatformWindow(this IUIWindowSceneDelegate sceneDelegat
dicts.Add(session.UserInfo);
if (session.StateRestorationActivity?.UserInfo is not null)
dicts.Add(session.StateRestorationActivity.UserInfo);
if (connectionOptions.UserActivities is not null)
try
{
foreach (var u in connectionOptions.UserActivities)
using var activities = connectionOptions.UserActivities;
if (activities is not null)
{
if (u is NSUserActivity userActivity && userActivity.UserInfo is not null)
dicts.Add(userActivity.UserInfo);
foreach (var u in activities)
{
if (u is NSUserActivity userActivity && userActivity.UserInfo is not null)
dicts.Add(userActivity.UserInfo);
}
}
}
catch (InvalidCastException)
{
// HACK: Workaround for https://github.com/xamarin/xamarin-macios/issues/13704
// This only throws if the collection is empty.
}

var window = CreatePlatformWindow(application, scene as UIWindowScene, dicts.ToArray());
if (window is not null)
Expand Down
30 changes: 24 additions & 6 deletions src/Essentials/src/Platform/WindowStateManager.ios.cs
Original file line number Diff line number Diff line change
Expand Up @@ -101,9 +101,18 @@ public void Init(Func<UIViewController?>? getCurrentUIViewController) =>
// if we have scene support, use that
if (OperatingSystem.IsIOSVersionAtLeast(13) || OperatingSystem.IsMacCatalystVersionAtLeast(13))
{
var scenes = UIApplication.SharedApplication.ConnectedScenes;
var windowScene = scenes.ToArray<UIWindowScene>().FirstOrDefault();
return windowScene?.Windows.FirstOrDefault();
try
{
using var scenes = UIApplication.SharedApplication.ConnectedScenes;
var windowScene = scenes.ToArray<UIWindowScene>().FirstOrDefault();
return windowScene?.Windows.FirstOrDefault();
}
catch (InvalidCastException)
{
// HACK: Workaround for https://github.com/xamarin/xamarin-macios/issues/13704
// This only throws if the collection is empty.
return null;
}
}

// use the windows property (up to 13.0)
Expand All @@ -115,9 +124,18 @@ public void Init(Func<UIViewController?>? getCurrentUIViewController) =>
// if we have scene support, use that
if (OperatingSystem.IsIOSVersionAtLeast(13) || OperatingSystem.IsMacCatalystVersionAtLeast(13))
{
var scenes = UIApplication.SharedApplication.ConnectedScenes;
var windowScene = scenes.ToArray<UIWindowScene>().FirstOrDefault();
return windowScene?.Windows;
try
{
using var scenes = UIApplication.SharedApplication.ConnectedScenes;
var windowScene = scenes.ToArray<UIWindowScene>().FirstOrDefault();
return windowScene?.Windows;
}
catch (InvalidCastException)
{
// HACK: Workaround for https://github.com/xamarin/xamarin-macios/issues/13704
// This only throws if the collection is empty.
return null;
}
}

// use the windows property (up to 15.0)
Expand Down

0 comments on commit a99302b

Please sign in to comment.