Fix Windows console hide path targeting the foreground window (#32)

This PR addresses [Ryubing/Issues#345](https://github.com/Ryubing/Issues/issues/345) by fixing the Windows console hide/show path so it only acts on Ryujinx’s own console window instead of whatever window happens to be focused during startup. Previously, when Show Console was disabled, the helper could race with focus changes and end up affecting another app or shell window while leaving the console visible; this change removes that foreground-window dependency and keeps the startup behavior scoped to the Ryujinx console.

Reviewed-on: https://git.ryujinx.app/projects/Ryubing/pulls/32
This commit is contained in:
Babib3l
2026-05-05 03:48:23 +00:00
committed by sh0inx
parent 4e86159bce
commit 4d0cd61b6a
4 changed files with 72 additions and 26 deletions

View File

@@ -656,10 +656,19 @@ namespace Ryujinx.Ava.UI.ViewModels
get => ConfigurationState.Instance.UI.ShowConsole;
set
{
bool restartRequired = value && !ConsoleHelper.HasConsoleWindow;
ConfigurationState.Instance.UI.ShowConsole.Value = value;
ConfigurationState.Instance.ToFileFormat().SaveConfig(Program.ConfigurationPath);
if (restartRequired)
{
NotificationHelper.ShowInformation(
LocaleManager.Instance[LocaleKeys.SettingsAppRequiredRestartMessage],
LocaleManager.Instance[LocaleKeys.SettingsShowConsoleRestartMessage]);
}
OnPropertyChanged();
}
}