PR Feedback
* A simpler version of the previous implementation. Co-Authored-By: gdkchan <5624669+gdkchan@users.noreply.github.com>
This commit is contained in:
parent
f9be522498
commit
e88b3cf0dd
1 changed files with 15 additions and 18 deletions
|
@ -103,11 +103,11 @@ namespace Ryujinx.Ava
|
||||||
ForceChangeCursor
|
ForceChangeCursor
|
||||||
};
|
};
|
||||||
|
|
||||||
private CursorStates cursorState = CursorStates.CursorIsVisible;
|
|
||||||
|
|
||||||
private CursorStates _cursorState = !ConfigurationState.Instance.Hid.EnableMouse.Value ?
|
private CursorStates _cursorState = !ConfigurationState.Instance.Hid.EnableMouse.Value ?
|
||||||
CursorStates.CursorIsVisible : CursorStates.CursorIsHidden;
|
CursorStates.CursorIsVisible : CursorStates.CursorIsHidden;
|
||||||
|
|
||||||
|
private bool _isCursorVisible = !ConfigurationState.Instance.Hid.EnableMouse.Value;
|
||||||
|
|
||||||
private bool _isStopped;
|
private bool _isStopped;
|
||||||
private bool _isActive;
|
private bool _isActive;
|
||||||
private bool _renderingStarted;
|
private bool _renderingStarted;
|
||||||
|
@ -239,10 +239,10 @@ namespace Ryujinx.Ava
|
||||||
|
|
||||||
|
|
||||||
_isCursorInRenderer = point.X >= bounds.X &&
|
_isCursorInRenderer = point.X >= bounds.X &&
|
||||||
Math.Ceiling(point.X) <= (int)window.Bounds.Width &&
|
Math.Ceiling(point.X) <= (int)window.Bounds.Width &&
|
||||||
point.Y >= windowYOffset &&
|
point.Y >= windowYOffset &&
|
||||||
point.Y <= windowYLimit &&
|
point.Y <= windowYLimit &&
|
||||||
!_viewModel.IsSubMenuOpen;
|
!_viewModel.IsSubMenuOpen;
|
||||||
|
|
||||||
_ignoreCursorState = false;
|
_ignoreCursorState = false;
|
||||||
}
|
}
|
||||||
|
@ -266,9 +266,9 @@ namespace Ryujinx.Ava
|
||||||
}
|
}
|
||||||
|
|
||||||
_ignoreCursorState = (point.X == bounds.X ||
|
_ignoreCursorState = (point.X == bounds.X ||
|
||||||
Math.Ceiling(point.X) == (int)window.Bounds.Width) &&
|
Math.Ceiling(point.X) == (int)window.Bounds.Width) &&
|
||||||
point.Y >= windowYOffset &&
|
point.Y >= windowYOffset &&
|
||||||
point.Y <= windowYLimit;
|
point.Y <= windowYLimit;
|
||||||
|
|
||||||
}
|
}
|
||||||
_cursorState = CursorStates.ForceChangeCursor;
|
_cursorState = CursorStates.ForceChangeCursor;
|
||||||
|
@ -1105,21 +1105,18 @@ namespace Ryujinx.Ava
|
||||||
{
|
{
|
||||||
if (ConfigurationState.Instance.Hid.EnableMouse.Value)
|
if (ConfigurationState.Instance.Hid.EnableMouse.Value)
|
||||||
{
|
{
|
||||||
cursorState = ConfigurationState.Instance.HideCursor.Value == HideCursorMode.Never
|
_isCursorVisible = ConfigurationState.Instance.HideCursor.Value == HideCursorMode.Never;
|
||||||
? CursorStates.CursorIsVisible
|
|
||||||
: CursorStates.CursorIsHidden;
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
cursorState = ConfigurationState.Instance.HideCursor.Value == HideCursorMode.Never ||
|
_isCursorVisible = ConfigurationState.Instance.HideCursor.Value == HideCursorMode.Never ||
|
||||||
Stopwatch.GetTimestamp() - _lastCursorMoveTime < CursorHideIdleTime * Stopwatch.Frequency
|
(ConfigurationState.Instance.HideCursor.Value == HideCursorMode.OnIdle &&
|
||||||
? CursorStates.CursorIsVisible
|
Stopwatch.GetTimestamp() - _lastCursorMoveTime < CursorHideIdleTime * Stopwatch.Frequency);
|
||||||
: CursorStates.CursorIsHidden;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (_cursorState != cursorState)
|
if (_cursorState != (_isCursorVisible ? CursorStates.CursorIsVisible : CursorStates.CursorIsHidden))
|
||||||
{
|
{
|
||||||
if (cursorState == CursorStates.CursorIsVisible)
|
if (_isCursorVisible)
|
||||||
{
|
{
|
||||||
ShowCursor();
|
ShowCursor();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue