Merge branch 'Tryibion-game-window-focus-issue'

This commit is contained in:
Wojtek Figat
2023-10-04 19:58:36 +02:00

View File

@@ -463,6 +463,18 @@ namespace FlaxEditor.Windows
Cursor = CursorType.Default;
}
/// <inheritdoc />
public override void 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 />
public override void OnShowContextMenu(ContextMenu menu)
{