This commit is contained in:
Wojtek Figat
2023-10-04 19:58:10 +02:00
parent 8811c9cda0
commit f2a3338dce

View File

@@ -466,8 +466,13 @@ namespace FlaxEditor.Windows
/// <inheritdoc /> /// <inheritdoc />
public override void OnMouseLeave() public override void OnMouseLeave()
{ {
Parent?.Focus();
base.OnMouseLeave(); base.OnMouseLeave();
// Remove focus from game window when mouse moves out and the cursor is hidden during game
if ((IsFocused || ContainsFocus) && Parent != null && Editor.IsPlayMode && !Screen.CursorVisible)
{
Parent.Focus();
}
} }
/// <inheritdoc /> /// <inheritdoc />