Add hide-cursor command line argument & always hide cursor option (#4613)
* Add hide-cursor command line argument * gtk: Adjust SettingsWindow for hide cursor options * ava: Adjust SettingsWindow for hide cursor options * ava: Add override check for HideCursor arg * Remove copy&paste sins * ava: Leave a little more room between the options * gtk: Fix hide cursor issues * ava: Only hide cursor if it's within the embedded window
This commit is contained in:
parent
2c94ac455e
commit
dd574146fb
20 changed files with 266 additions and 99 deletions
|
@ -157,7 +157,7 @@ namespace Ryujinx.Ava
|
|||
_isFirmwareTitle = true;
|
||||
}
|
||||
|
||||
ConfigurationState.Instance.HideCursorOnIdle.Event += HideCursorState_Changed;
|
||||
ConfigurationState.Instance.HideCursor.Event += HideCursorState_Changed;
|
||||
|
||||
_topLevel.PointerMoved += TopLevel_PointerMoved;
|
||||
|
||||
|
@ -468,9 +468,9 @@ namespace Ryujinx.Ava
|
|||
(_rendererHost.EmbeddedWindow as EmbeddedWindowOpenGL)?.MakeCurrent(null);
|
||||
}
|
||||
|
||||
private void HideCursorState_Changed(object sender, ReactiveEventArgs<bool> state)
|
||||
private void HideCursorState_Changed(object sender, ReactiveEventArgs<HideCursorMode> state)
|
||||
{
|
||||
if (state.NewValue)
|
||||
if (state.NewValue == HideCursorMode.OnIdle)
|
||||
{
|
||||
_lastCursorMoveTime = Stopwatch.GetTimestamp();
|
||||
}
|
||||
|
@ -965,30 +965,38 @@ namespace Ryujinx.Ava
|
|||
|
||||
if (_viewModel.IsActive)
|
||||
{
|
||||
if (ConfigurationState.Instance.Hid.EnableMouse)
|
||||
if (_isCursorInRenderer)
|
||||
{
|
||||
if (_isCursorInRenderer)
|
||||
if (ConfigurationState.Instance.Hid.EnableMouse)
|
||||
{
|
||||
HideCursor();
|
||||
}
|
||||
else
|
||||
{
|
||||
ShowCursor();
|
||||
switch (ConfigurationState.Instance.HideCursor.Value)
|
||||
{
|
||||
case HideCursorMode.Never:
|
||||
ShowCursor();
|
||||
break;
|
||||
case HideCursorMode.OnIdle:
|
||||
if (Stopwatch.GetTimestamp() - _lastCursorMoveTime >= CursorHideIdleTime * Stopwatch.Frequency)
|
||||
{
|
||||
HideCursor();
|
||||
}
|
||||
else
|
||||
{
|
||||
ShowCursor();
|
||||
}
|
||||
break;
|
||||
case HideCursorMode.Always:
|
||||
HideCursor();
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (ConfigurationState.Instance.HideCursorOnIdle)
|
||||
{
|
||||
if (Stopwatch.GetTimestamp() - _lastCursorMoveTime >= CursorHideIdleTime * Stopwatch.Frequency)
|
||||
{
|
||||
HideCursor();
|
||||
}
|
||||
else
|
||||
{
|
||||
ShowCursor();
|
||||
}
|
||||
}
|
||||
ShowCursor();
|
||||
}
|
||||
|
||||
Dispatcher.UIThread.Post(() =>
|
||||
|
@ -1133,4 +1141,4 @@ namespace Ryujinx.Ava
|
|||
return state;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue