diff --git a/osu.Game/Overlays/Settings/Sections/Graphics/LayoutSettings.cs b/osu.Game/Overlays/Settings/Sections/Graphics/LayoutSettings.cs index f1211e3a60..99d47aab1f 100644 --- a/osu.Game/Overlays/Settings/Sections/Graphics/LayoutSettings.cs +++ b/osu.Game/Overlays/Settings/Sections/Graphics/LayoutSettings.cs @@ -40,6 +40,7 @@ namespace osu.Game.Overlays.Settings.Sections.Graphics private readonly BindableList resolutionsFullscreen = new BindableList(new[] { new Size(9999, 9999) }); private readonly BindableList resolutionsWindowed = new BindableList(); + private readonly Bindable windowedResolution = new Bindable(); private readonly IBindable fullscreenCapability = new Bindable(FullscreenCapability.Capable); [Resolved] @@ -84,6 +85,8 @@ namespace osu.Game.Overlays.Settings.Sections.Graphics scalingPositionY = osuConfig.GetBindable(OsuSetting.ScalingPositionY); scalingBackgroundDim = osuConfig.GetBindable(OsuSetting.ScalingBackgroundDim); + windowedResolution.Value = sizeWindowed.Value; + if (window != null) { currentDisplay.BindTo(window.CurrentDisplayBindable); @@ -120,7 +123,7 @@ namespace osu.Game.Overlays.Settings.Sections.Graphics LabelText = GraphicsSettingsStrings.Resolution, ShowsDefaultIndicator = false, ItemSource = resolutionsWindowed, - Current = sizeWindowed + Current = windowedResolution }, minimiseOnFocusLossCheckbox = new SettingsCheckbox { @@ -222,7 +225,7 @@ namespace osu.Game.Overlays.Settings.Sections.Graphics return; } - var buffer = new Bindable(sizeWindowed.Value); + var buffer = new Bindable(windowedResolution.Value); resolutionWindowedDropdown.Current = buffer; var newResolutions = display.NewValue.DisplayModes @@ -235,16 +238,18 @@ namespace osu.Game.Overlays.Settings.Sections.Graphics resolutionsFullscreen.ReplaceRange(1, resolutionsFullscreen.Count - 1, newResolutions); resolutionsWindowed.ReplaceRange(0, resolutionsWindowed.Count, newResolutions); - resolutionWindowedDropdown.Current = sizeWindowed; + resolutionWindowedDropdown.Current = windowedResolution; updateDisplaySettingsVisibility(); }), true); - sizeWindowed.BindValueChanged(size => + windowedResolution.BindValueChanged(size => { - if (windowModeDropdown.Current.Value != WindowMode.Windowed) + if (size.NewValue == sizeWindowed.Value || windowModeDropdown.Current.Value != WindowMode.Windowed) return; + sizeWindowed.Value = size.NewValue; + if (window?.WindowState == Framework.Platform.WindowState.Maximised) { window.WindowState = Framework.Platform.WindowState.Normal; @@ -254,6 +259,12 @@ namespace osu.Game.Overlays.Settings.Sections.Graphics windowedPositionY.Value = 0.5; }); + sizeWindowed.BindValueChanged(size => + { + if (size.NewValue != windowedResolution.Value) + windowedResolution.Value = size.NewValue; + }); + scalingMode.BindValueChanged(_ => { scalingSettings.ClearTransforms();