From 4abf47402cc61527fb7a2a8b2dd64338805ae625 Mon Sep 17 00:00:00 2001 From: Sandy Armstrong Date: Tue, 26 Apr 2022 15:42:09 -0700 Subject: Mac: Make dialog window key when showing Fixes scenarios where a dialog is shown but a background window continues receiving input. --- Xwt.XamMac/Xwt.Mac/DialogBackend.cs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Xwt.XamMac/Xwt.Mac/DialogBackend.cs b/Xwt.XamMac/Xwt.Mac/DialogBackend.cs index effc9372..f98d52c1 100644 --- a/Xwt.XamMac/Xwt.Mac/DialogBackend.cs +++ b/Xwt.XamMac/Xwt.Mac/DialogBackend.cs @@ -174,6 +174,10 @@ namespace Xwt.Mac nsParent = NSApplication.SharedApplication.ModalWindow ?? NSApplication.SharedApplication.KeyWindow; } + // Next, make this window key before adding it as a child. + // This matches behavior in MonoDevelop.Ide.MessageService.RunCustomDialog. + MakeKeyAndOrderFront(NSApplication.SharedApplication); + if (nsParent != null && nsParent.IsVisible) { nsParent.AddChildWindow(this, NSWindowOrderingMode.Above); -- cgit v1.2.3