Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add initial support for Multiple Windows on MacOS #2260

Closed

Conversation

ne0rrmatrix
Copy link
Contributor

@ne0rrmatrix ne0rrmatrix commented Oct 5, 2024

  • Bug fix

Description of Change

Add support for more than one window on MacOS. With this PR Media Element will now show multiple windows when you visit the Multi-Window Page on MacOS.

Linked Issues

PR Checklist

Additional information

With this PR MacOS will fully support multiple windows on MacOS when using Media Element. Documentation will need updating to add the changes to Manifest file for MacOS.

@ne0rrmatrix ne0rrmatrix self-assigned this Oct 5, 2024
@ne0rrmatrix ne0rrmatrix added the 📽️ MediaElement Issue/PR that has to do with MediaElement label Oct 5, 2024
@TheCodeTraveler
Copy link
Collaborator

Nice! Could you open a Docs PR to add this info to the MediaElement Platform Specific Initialization section before we merge this PR?

https://learn.microsoft.com/en-us/dotnet/communitytoolkit/maui/views/mediaelement?tabs=mac#platform-specific-initialization

@ne0rrmatrix
Copy link
Contributor Author

Nice! Could you open a Docs PR to add this info to the MediaElement Platform Specific Initialization section before we merge this PR?

https://learn.microsoft.com/en-us/dotnet/communitytoolkit/maui/views/mediaelement?tabs=mac#platform-specific-initialization

Yes I will do that now 😄

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot reviewed 2 out of 3 changed files in this pull request and generated no suggestions.

Files not reviewed (1)
  • samples/CommunityToolkit.Maui.Sample/Platforms/MacCatalyst/Info.plist: Language not supported
{
// Exit the app when the last window closes
// This ensures app closes when last window closes on Mac
Environment.Exit(0);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this a correct thing to do though? I honestly don't know hence the question.

I ask primarily because of this https://superuser.com/questions/53935/getting-mac-os-x-applications-to-close-after-last-window-closed/53940#53940 answer.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

^^ @ne0rrmatrix friendly ping

#if MACCATALYST
protected override Window CreateWindow(IActivationState? activationState)
{
Window window = base.CreateWindow(activationState);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So, e.g., on Windows the call is new Window(appShell) and on Mac Catalyst it is base.CreateWindow(activationState).

Is this by design that appShell is not passed in? Again honest question.

@ne0rrmatrix
Copy link
Contributor Author

Looking at this closely I realized it does not support all devices and I have another idea I am working on. I will close this as it not compliant with guidelines for new features. IE, it has not gone through the process of being evaluated and it does not bypass it by being a fix for a bug report. Adding new features that require code maintence and ongoing support should be voted on and go through the approval process.

@github-actions github-actions bot locked and limited conversation to collaborators Jan 30, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
📽️ MediaElement Issue/PR that has to do with MediaElement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[BUG] MediaElement not supported in a DataTemplate on MacCatalyst in an application using multiple windows
3 participants