-
Notifications
You must be signed in to change notification settings - Fork 460
Fix Media Element Full Screen in Windows when using Multiple Windows #2506
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
base: main
Are you sure you want to change the base?
Fix Media Element Full Screen in Windows when using Multiple Windows #2506
Conversation
…Window` for grabbing correct window in multi-window environment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR fixes a bug where MediaElement full screen mode doesn't work correctly when multiple windows are active on Windows. The fix changes how the app window is identified for full screen operations by using the foreground window instead of the current page's window.
- Replaces static app window caching with dynamic foreground window detection
- Uses Windows API
GetForegroundWindow()
to identify the correct window for full screen operations - Enables unsafe blocks in the project to support P/Invoke calls
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
File | Description |
---|---|
MauiMediaElement.windows.cs | Implements P/Invoke to GetForegroundWindow and updates window detection logic |
CommunityToolkit.Maui.MediaElement.csproj | Enables unsafe blocks to support P/Invoke functionality |
src/CommunityToolkit.Maui.MediaElement/Views/MauiMediaElement.windows.cs
Show resolved
Hide resolved
src/CommunityToolkit.Maui.MediaElement/Views/MauiMediaElement.windows.cs
Outdated
Show resolved
Hide resolved
…windows.cs Co-authored-by: Copilot <[email protected]>
…)` and if it is null throw InvalidOperationException if window is null.
Description of Change
Fix window behavior when entering full screen mode while you have mulitple windows active.
Linked Issues
PR Checklist
approved
(bug) orChampioned
(feature/proposal)main
at time of PR2025-02-10.06-44-08.mp4