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

The modal dialog flashes on macOS when clicking on the parent window #15649

Open
baochenw opened this issue May 8, 2024 · 2 comments
Open

The modal dialog flashes on macOS when clicking on the parent window #15649

baochenw opened this issue May 8, 2024 · 2 comments

Comments

@baochenw
Copy link

baochenw commented May 8, 2024

Describe the bug

The modal dialog flashes on macOS when clicking the parent window.

Screen.Recording.2024-04-28.at.16.14.49.mov

To Reproduce

  1. Show modal with ShowDialog method.
var dialog = new Window();
dialog.ShowDialog(MainWindow);
  1. Click on the main window

Expected behavior

The dialog is modal and no flashes when clicking parent window.

Avalonia version

11.0.9

OS

macOS

Additional context

I've delved deeper into the issue, and it appears that on macOS, Apple's API isn't used to implement the modal dialog. Instead, a trick is used to reactivate the dialog.
https://github.com/AvaloniaUI/Avalonia/blob/master/src/Avalonia.Controls/Window.cs#L905-L926

Is it possible to use system API to show modal dialog?

@baochenw baochenw added the bug label May 8, 2024
@rabbitism
Copy link
Contributor

Is this specific to Ursa or all cases?

@baochenw
Copy link
Author

baochenw commented May 8, 2024

It is also reproducible with Avalonia sample app.

Screen.Recording.2024-05-08.at.18.55.08.mov

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants