maui icon indicating copy to clipboard operation
maui copied to clipboard

[Mac Catalyst] Application.Current.OpenWindow not working

Open davidbritch opened this issue 3 years ago • 6 comments

Description

Application.Current.OpenWindow(new Window(new MainPage())); works fine on Windows, in .NET 7 RC1, but does nothing on Mac Catalyst. Similarly, Application.Current.CloseWindow(Window); works fine on Windows, but does nothing on Mac Catalyst.

No exceptions. No errors. No new window.

Steps to Reproduce

  1. Run repo project on Mac Catalyst.
  2. Click button to open a new window. Nothing happens.

Link to public reproduction project repository

https://github.com/davidbritch/dotnet-maui-issues/tree/main/WindowSizeDemo

Version with bug

.NET 7 RC1.

Last version that worked well

Unknown/Other

Affected platforms

macOS

Affected platform versions

N/A

Did you find any workaround?

No response

Relevant log output

No response

davidbritch avatar Oct 11 '22 09:10 davidbritch

Confirmed that this is no longer an issue once I remembered to add the SceneDelegate/Info.plist config.

davidbritch avatar Oct 11 '22 11:10 davidbritch

We've moved this issue to the Backlog milestone. This means that it is not going to be worked on for the coming release. We will reassess the backlog following the current release and consider this item at that time. To learn more about our issue management process and to have better expectation regarding different types of issues you can read our Triage Process.

ghost avatar Oct 11 '22 18:10 ghost

I was hoping to make this all work by default, but will need to wait for this: https://dev.azure.com/devdiv/DevDiv/_workitems/edit/1641233/

mattleibow avatar Oct 11 '22 18:10 mattleibow

any updates on this? Multi-Window doesn't work for me on macOS

nor0x avatar Dec 22 '22 21:12 nor0x

Hi @nor0x

It works on my machine - check out https://github.com/davidbritch/dotnet-maui-issues/tree/main/WindowSizeDemo. You have to add SceneDelegate.cs and configure Info.plist to make it work on Mac Catalyst.

@mattleibow Personally I'd close this issue, or rename it at least.

davidbritch avatar Dec 23 '22 08:12 davidbritch

thanks for the reply @davidbritch - turns out it was a typo in my plist file. Everything good now 🥳

nor0x avatar Dec 23 '22 10:12 nor0x

If anyone hits this issue on Mac Catalyst, then I recommend to read https://learn.microsoft.com/en-gb/dotnet/maui/fundamentals/windows?view=net-maui-7.0#ipados-and-macos-configuration. This issue was very helpful in discovering the root problem.

Plus, https://github.com/davidbritch/dotnet-maui-issues/blob/f8a21f5735c6cafe6266449f83905725de520b70/WindowSizeDemo/WindowSizeDemo/Platforms/MacCatalyst/Info.plist#L29-L45 this is how to add it correctly to your Info.plist file.

MartyIX avatar Jan 03 '23 14:01 MartyIX

Hi @davidbritch. We have added the "s/try-latest-version" label to this issue, which indicates that we'd like you to try and reproduce this issue on the latest available public version. This can happen because we think that this issue was fixed in a version that has just been released, or the information provided by you indicates that you might be working with an older version.

You can install the latest version by installing the latest Visual Studio (Preview) with the .NET MAUI workload installed. If the issue still persists, please let us know with any additional details and ideally a reproduction project provided through a GitHub repository.

This issue will be closed automatically in 7 days if we do not hear back from you by then - please feel free to re-open it if you come back to this issue after that time.

ghost avatar Jul 11 '23 08:07 ghost

Verified this issue with VS for Mac 17.6.0.1575. Not repro on macOS with sample project. WindowSizeDemo Screenshot 2023-07-11 at 16 16 50

jinxinjuan avatar Jul 11 '23 08:07 jinxinjuan