Open baochenw opened 4 months ago
The modal dialog flashes on macOS when clicking the parent window.
https://github.com/AvaloniaUI/Avalonia/assets/1419783/55fb6ebe-ea16-4462-aba5-8badde0dfbb2
Show modal with ShowDialog method.
ShowDialog
var dialog = new Window(); dialog.ShowDialog(MainWindow);
Click on the main window
The dialog is modal and no flashes when clicking parent window.
11.0.9
macOS
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?
Is this specific to Ursa or all cases?
It is also reproducible with Avalonia sample app.
https://github.com/AvaloniaUI/Avalonia/assets/1419783/571b7ef3-0f74-4d4f-9006-13167865b3b1
Describe the bug
The modal dialog flashes on macOS when clicking the parent window.
https://github.com/AvaloniaUI/Avalonia/assets/1419783/55fb6ebe-ea16-4462-aba5-8badde0dfbb2
To Reproduce
Show modal with
ShowDialog
method.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?