question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[Mac Catalyst] Application.Current.OpenWindow not working

See original GitHub issue

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

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:9 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
MartyIXcommented, Jan 3, 2023

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.

0reactions
jinxinjuancommented, Jul 11, 2023

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

Read more comments on GitHub >

github_iconTop Results From Across the Web

Open a new window in Mac Catalyst - ios
And you're basically done. Run your app, and hit command + N to create as many new windows as you want.
Read more >
openWindow | Apple Developer Documentation
openWindow. An window presentation action stored in a view's environment. iOS 16.0+ iPadOS 16.0+ macOS 13.0+ Mac Catalyst 16.0+ visionOS 1.0+ Beta.
Read more >
NET MAUI windows
Learn how to use the .NET MAUI Window class to create, configure, show, and manage multi-window apps.
Read more >
Exploring Multi-window Apps in .NET MAUI Preview 11
NET MAUI development(on the mac) I've been able to use Visual Studio Mac Preview, in this case I've updated to the latest version...
Read more >
Going Desktop with .NET MAUI
NET MAUI uses two of the latest and well-established ways of reaching desktop—WinUI for Windows and Mac Catalyst for macOS.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found