From 6f1d9648016c9442f6dcdac257f28c1a7a19aca0 Mon Sep 17 00:00:00 2001 From: pineappleEA <67879877+pineappleEA@users.noreply.github.com> Date: Mon, 15 Feb 2021 23:48:21 +0200 Subject: Hide Cursor On Idle (#1993) * Implement "Hide Cursor On Idle" option Adds a general option to autohide the cursor after 8s have elapsed. * Fix cursor not hiding on Windows and dispose it * Don't dispose cursor, fix var names * Abide by the GNOME documentation * Fix nits * Disabled by default, make it so it doesn't utilize any timer * Remove *NIX time and extra lines * Don't calculate if option is disabled * Move if case * Fix alignment --- Ryujinx.Common/Configuration/ConfigurationState.cs | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'Ryujinx.Common/Configuration/ConfigurationState.cs') diff --git a/Ryujinx.Common/Configuration/ConfigurationState.cs b/Ryujinx.Common/Configuration/ConfigurationState.cs index 61cc8f89..d51ee9ef 100644 --- a/Ryujinx.Common/Configuration/ConfigurationState.cs +++ b/Ryujinx.Common/Configuration/ConfigurationState.cs @@ -365,6 +365,11 @@ namespace Ryujinx.Configuration /// public ReactiveObject ShowConfirmExit { get; private set; } + /// + /// Hide Cursor on Idle + /// + public ReactiveObject HideCursorOnIdle { get; private set; } + private ConfigurationState() { Ui = new UiSection(); @@ -375,6 +380,7 @@ namespace Ryujinx.Configuration EnableDiscordIntegration = new ReactiveObject(); CheckUpdatesOnStart = new ReactiveObject(); ShowConfirmExit = new ReactiveObject(); + HideCursorOnIdle = new ReactiveObject(); } public ConfigurationFileFormat ToFileFormat() @@ -420,6 +426,7 @@ namespace Ryujinx.Configuration EnableDiscordIntegration = EnableDiscordIntegration, CheckUpdatesOnStart = CheckUpdatesOnStart, ShowConfirmExit = ShowConfirmExit, + HideCursorOnIdle = HideCursorOnIdle, EnableVsync = Graphics.EnableVsync, EnableShaderCache = Graphics.EnableShaderCache, EnablePtc = System.EnablePtc, @@ -483,6 +490,7 @@ namespace Ryujinx.Configuration EnableDiscordIntegration.Value = true; CheckUpdatesOnStart.Value = true; ShowConfirmExit.Value = true; + HideCursorOnIdle.Value = false; Graphics.EnableVsync.Value = true; Graphics.EnableShaderCache.Value = true; System.EnablePtc.Value = true; @@ -787,6 +795,15 @@ namespace Ryujinx.Configuration configurationFileUpdated = true; } + if (configurationFileFormat.Version < 22) + { + Common.Logging.Logger.Warning?.Print(LogClass.Application, $"Outdated configuration version {configurationFileFormat.Version}, migrating to version 22."); + + configurationFileFormat.HideCursorOnIdle = false; + + configurationFileUpdated = true; + } + List inputConfig = new List(); inputConfig.AddRange(configurationFileFormat.ControllerConfig); inputConfig.AddRange(configurationFileFormat.KeyboardConfig); @@ -814,6 +831,7 @@ namespace Ryujinx.Configuration EnableDiscordIntegration.Value = configurationFileFormat.EnableDiscordIntegration; CheckUpdatesOnStart.Value = configurationFileFormat.CheckUpdatesOnStart; ShowConfirmExit.Value = configurationFileFormat.ShowConfirmExit; + HideCursorOnIdle.Value = configurationFileFormat.HideCursorOnIdle; Graphics.EnableVsync.Value = configurationFileFormat.EnableVsync; Graphics.EnableShaderCache.Value = configurationFileFormat.EnableShaderCache; System.EnablePtc.Value = configurationFileFormat.EnablePtc; -- cgit v1.2.3