Skip to content

Conversation

ne0rrmatrix
Copy link
Contributor

  • Bug fix

Description of Change

Fix window behavior when entering full screen mode while you have mulitple windows active.

Linked Issues

PR Checklist

  • Has a linked Issue, and the Issue has been approved(bug) or Championed (feature/proposal)
  • Has tests (if omitted, state reason in description)
  • Has samples (if omitted, state reason in description)
  • Rebased on top of main at time of PR
  • Changes adhere to coding standard
  • Documentation created or updated: https://github.com/MicrosoftDocs/CommunityToolkit/pulls
2025-02-10.06-44-08.mp4

@Copilot Copilot AI review requested due to automatic review settings August 3, 2025 22:54
Copy link
Contributor

@Copilot Copilot AI left a 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

ne0rrmatrix and others added 2 commits August 3, 2025 15:57
…)` and if it is null throw InvalidOperationException if window is null.
@dotnet-policy-service dotnet-policy-service bot added stale The author has not responded in over 30 days help wanted This proposal has been approved and is ready to be implemented labels Sep 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted This proposal has been approved and is ready to be implemented stale The author has not responded in over 30 days
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[BUG] Windows Media Element crash on full screen exit in multi window Environment
2 participants