Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/xwt.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'Xwt.XamMac/Xwt.Mac/AlertDialogBackend.cs')
-rw-r--r--Xwt.XamMac/Xwt.Mac/AlertDialogBackend.cs13
1 files changed, 13 insertions, 0 deletions
diff --git a/Xwt.XamMac/Xwt.Mac/AlertDialogBackend.cs b/Xwt.XamMac/Xwt.Mac/AlertDialogBackend.cs
index acf66e21..64a4fc52 100644
--- a/Xwt.XamMac/Xwt.Mac/AlertDialogBackend.cs
+++ b/Xwt.XamMac/Xwt.Mac/AlertDialogBackend.cs
@@ -112,6 +112,19 @@ namespace Xwt.Mac
Window.ReleasedWhenClosed = true;
if (win != null)
return sortedButtons [(int)this.RunSheetModal (win) - 1000];
+
+ if (win == null)
+ {
+ //a modal dialog needs parent window so we try take the current key
+ win = NSApplication.SharedApplication.ModalWindow ?? NSApplication.SharedApplication.KeyWindow;
+ }
+
+ if (win != null)
+ {
+ win.AddChildWindow(this.Window, NSWindowOrderingMode.Above);
+ }
+
+ Util.CenterWindow(this.Window, win);
return sortedButtons [(int)this.RunModal () - 1000];
}