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:
authorJose Medrano <josmed@microsoft.com>2022-04-07 14:32:13 +0300
committerJose Medrano <josmed@microsoft.com>2022-04-07 14:32:13 +0300
commita2487a8cf5dd6446a78bf744b40b409cc345f03a (patch)
tree873bd84c665c718a194023438757077bb53045fc
parentdc0bab08d2d176289699362426a13523430bcdfa (diff)
If the window is already visible we set the association
-rw-r--r--Xwt.XamMac/Xwt.Mac/WindowFrameBackend.cs16
1 files changed, 11 insertions, 5 deletions
diff --git a/Xwt.XamMac/Xwt.Mac/WindowFrameBackend.cs b/Xwt.XamMac/Xwt.Mac/WindowFrameBackend.cs
index ae43d353..86fc236e 100644
--- a/Xwt.XamMac/Xwt.Mac/WindowFrameBackend.cs
+++ b/Xwt.XamMac/Xwt.Mac/WindowFrameBackend.cs
@@ -96,17 +96,21 @@ namespace Xwt.Mac
internal void InternalShow ()
{
Window.MakeKeyAndOrderFront (MacEngine.App);
+
var parentWindow = Window.ParentWindow;
+ TryAddChildWindowIfVisible(parentWindow, Window);
+ //we center in any case
+ Util.CenterWindow(Window, parentWindow);
+ }
+ void TryAddChildWindowIfVisible(NSWindow parentWindow, NSWindow window)
+ {
if (parentWindow != null && Visible)
{
//if there is any child window we remove it
- if (!parentWindow.ChildWindows.Contains (Window))
- parentWindow.AddChildWindow (Window, NSWindowOrderingMode.Above);
+ if (!parentWindow.ChildWindows.Contains(window))
+ parentWindow.AddChildWindow(window, NSWindowOrderingMode.Above);
}
-
- //we center in any case
- Util.CenterWindow(Window, parentWindow);
}
public void Present ()
@@ -347,6 +351,8 @@ namespace Xwt.Mac
nParent.ParentWindow.RemoveChildWindow(nParent);
Window.ParentWindow = nParent;
+
+ TryAddChildWindowIfVisible(nParent, Window);
}
}