public partial class MyApp : Application
{
// not shown: keep this list of all your non-main windows updated...
public List<Window> rgw = new List<Window>();
protected override void OnActivated(EventArgs e)
{
// when app is ACTIVE, set all `Owner` values to null...
rgw.ForEach(w => w.Owner = null);
base.OnActivated(e);
}
protected override void OnDeactivated(EventArgs e)
{
// set `Owner` on all non-main Windows only when not-active
rgw.ForEach(w => w.Owner = Current.MainWindow);
base.OnDeactivated(e);
}
// etc..
}