File tree 2 files changed +12
-6
lines changed
2 files changed +12
-6
lines changed Original file line number Diff line number Diff line change @@ -70,14 +70,15 @@ public virtual void Show()
70
70
Control . MakeKeyWindow ( ) ;
71
71
else
72
72
Control . MakeKeyAndOrderFront ( ApplicationHandler . Instance . AppDelegate ) ;
73
+
74
+ // setting the owner shows the window, so we have to do this after making the window key
75
+ EnsureOwner ( ) ;
73
76
}
74
- else
77
+ else if ( ! EnsureOwner ( ) )
75
78
{
79
+ // only order front when there is no owner as it'll bring the owner above any existing non-child windows
76
80
Control . OrderFront ( ApplicationHandler . Instance . AppDelegate ) ;
77
81
}
78
-
79
- // setting the owner shows the window, so we have to do this here.
80
- EnsureOwner ( ) ;
81
82
82
83
if ( ! visible )
83
84
{
Original file line number Diff line number Diff line change @@ -1247,10 +1247,13 @@ public bool SetAsChildWindow
1247
1247
set => Widget . Properties . Set ( MacWindow . SetAsChildWindow_Key , value , DefaultSetAsChildWindow ) ;
1248
1248
}
1249
1249
1250
- protected void EnsureOwner ( ) => SetOwner ( Widget . Owner ) ;
1250
+ protected bool EnsureOwner ( ) => InternalSetOwner ( Widget . Owner ) ;
1251
1251
1252
- public virtual void SetOwner ( Window owner )
1252
+ public virtual void SetOwner ( Window owner ) => InternalSetOwner ( owner ) ;
1253
+
1254
+ bool InternalSetOwner ( Window owner )
1253
1255
{
1256
+ bool result = false ;
1254
1257
if ( SetAsChildWindow && Widget . Loaded )
1255
1258
{
1256
1259
if ( owner != null )
@@ -1260,6 +1263,7 @@ public virtual void SetOwner(Window owner)
1260
1263
{
1261
1264
macWindow . Control . AddChildWindow ( Control , NSWindowOrderingMode . Above ) ;
1262
1265
OnSetAsChildWindow ( ) ;
1266
+ result = true ;
1263
1267
}
1264
1268
Widget . GotFocus += HandleGotFocusAsChild ;
1265
1269
}
@@ -1271,6 +1275,7 @@ public virtual void SetOwner(Window owner)
1271
1275
parentWindow . RemoveChildWindow ( Control ) ;
1272
1276
}
1273
1277
}
1278
+ return result ;
1274
1279
}
1275
1280
1276
1281
void HandleGotFocusAsChild ( object sender , EventArgs e )
You can’t perform that action at this time.
0 commit comments