Skip to content

[BUG] Popup Does Not Support Multi-Window #1275

@babenkovitaliy

Description

@babenkovitaliy

Is there an existing issue for this?

  • I have searched the existing issues

Did you read the "Reporting a bug" section on Contributing file?

Current Behavior

ShowPopup() and ShowPopupAsync() results in the popup generating in a wrong window on a MacCatalyst application. This requires that MacCatalyst has multi window enabled.

I originally stumbled upon this issue when I opened up another window and tried to display a popup. It resulted in the popup displaying on a primary screen. Attempting to reproduce works, but sporadically - I could not figure out exactly what was the root cause. I tried opening up windows, focusing, resizing - anything to recreate the issue with 100% success rate (instead of 50%).

After running the tests, I figured out that I can recreate this problem with 100% success rate by opening up multiple windows (not just two). I will provide the steps to reproduce.

Expected Behavior

ShowPopup and ShowPopupAsync() should display the popup on the window that requested it.

Steps To Reproduce

  1. Clone the project from the GitHub repo.
  2. Open the solution in Visual Studio for Mac and click on the "Play" button to run the application in debug mode.
  3. You will now see a Mac app running. The main window will have a button that says "Click me to open a new window". Click on it two times to open up two windows. I'll call those "secondary windows".
  4. Move those two secondary windows side by side (to make it more easier to see the issue).
  5. Click on either one of the buttons on the left window ("Popup" or "PopupAsync" button).
  6. If the popup showed up on the right window when it should have showed up on the [same] left window, then you have successfully recreated the bug. If you were unable to replicate this, then try to click on either button on the right window instead. At this point, you should be able to replicate this.

Link to public reproduction project repository

https://github.com/babenkovitaliy/MAUIToolkitPopupBug

Environment

- .NET MAUI CommunityToolkit: 5.2.0
- OS: MacOS Ventura 13.4.1
- .NET MAUI: 7.0.86/7.0.100
- Hardware: MacBook Air M2, 2022

Anything else?

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions