Dont unfocus game window while cursor is not visible unless the lock mode is none.
This commit is contained in:
@@ -470,6 +470,10 @@ namespace FlaxEditor.Windows
|
|||||||
IsMaximized = false;
|
IsMaximized = false;
|
||||||
IsBorderless = false;
|
IsBorderless = false;
|
||||||
Cursor = CursorType.Default;
|
Cursor = CursorType.Default;
|
||||||
|
Screen.CursorLock = CursorLockMode.None;
|
||||||
|
if (Screen.MainWindow.IsMouseTracking)
|
||||||
|
Screen.MainWindow.EndTrackingMouse();
|
||||||
|
RootControl.GameRoot.EndMouseCapture();
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
@@ -478,7 +482,7 @@ namespace FlaxEditor.Windows
|
|||||||
base.OnMouseLeave();
|
base.OnMouseLeave();
|
||||||
|
|
||||||
// Remove focus from game window when mouse moves out and the cursor is hidden during game
|
// 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)
|
if (ContainsFocus && Parent != null && Editor.IsPlayMode && !Screen.CursorVisible && Screen.CursorLock == CursorLockMode.None)
|
||||||
{
|
{
|
||||||
Parent.Focus();
|
Parent.Focus();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user