0
0
Fork 0
mirror of https://github.com/ryujinx-mirror/ryujinx.git synced 2024-12-22 18:25:46 +00:00

Store and compare cursor-positions before updating last move time to fix idle-hiding

This commit is contained in:
Lukas Berger 2024-10-24 13:24:43 +02:00
parent 49574a99f5
commit fb310d1282
No known key found for this signature in database
GPG key ID: A89DC7C3CE658E60

View file

@ -89,6 +89,7 @@ namespace Ryujinx.Ava
private float _newVolume;
private KeyboardHotkeyState _prevHotkeyState;
private Point? _lastCursorPoint;
private long _lastCursorMoveTime;
private bool _isCursorInRenderer = true;
private bool _ignoreCursorState = false;
@ -221,12 +222,13 @@ namespace Ryujinx.Ava
if (sender is MainWindow window)
{
if (ConfigurationState.Instance.HideCursor.Value == HideCursorMode.OnIdle)
var point = e.GetCurrentPoint(window).Position;
if (ConfigurationState.Instance.HideCursor.Value == HideCursorMode.OnIdle && (_lastCursorPoint == null || _lastCursorPoint != point))
{
_lastCursorMoveTime = Stopwatch.GetTimestamp();
}
var point = e.GetCurrentPoint(window).Position;
var bounds = RendererHost.EmbeddedWindow.Bounds;
var windowYOffset = bounds.Y + window.MenuBarHeight;
var windowYLimit = (int)window.Bounds.Height - window.StatusBarHeight - 1;
@ -244,6 +246,7 @@ namespace Ryujinx.Ava
!_viewModel.IsSubMenuOpen;
_ignoreCursorState = false;
_lastCursorPoint = point;
}
}