1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-13 04:32:57 +08:00

Override confine mouse mode only when clicking outside the window would minimise it

This commit is contained in:
Susko3 2023-12-27 16:40:52 +01:00
parent c9de6a383d
commit 0fde9cd6ae

View File

@ -22,6 +22,7 @@ namespace osu.Game.Input
{
private Bindable<ConfineMouseMode> frameworkConfineMode;
private Bindable<WindowMode> frameworkWindowMode;
private Bindable<bool> frameworkMinimiseOnFocusLossInFullscreen;
private Bindable<OsuConfineMouseMode> osuConfineMode;
private IBindable<bool> localUserPlaying;
@ -31,7 +32,9 @@ namespace osu.Game.Input
{
frameworkConfineMode = frameworkConfigManager.GetBindable<ConfineMouseMode>(FrameworkSetting.ConfineMouseMode);
frameworkWindowMode = frameworkConfigManager.GetBindable<WindowMode>(FrameworkSetting.WindowMode);
frameworkMinimiseOnFocusLossInFullscreen = frameworkConfigManager.GetBindable<bool>(FrameworkSetting.MinimiseOnFocusLossInFullscreen);
frameworkWindowMode.BindValueChanged(_ => updateConfineMode());
frameworkMinimiseOnFocusLossInFullscreen.BindValueChanged(_ => updateConfineMode());
osuConfineMode = osuConfigManager.GetBindable<OsuConfineMouseMode>(OsuSetting.ConfineMouseMode);
localUserPlaying = localUserInfo.IsPlaying.GetBoundCopy();
@ -46,7 +49,8 @@ namespace osu.Game.Input
if (frameworkConfineMode.Disabled)
return;
if (frameworkWindowMode.Value == WindowMode.Fullscreen)
// override confine mode only when clicking outside the window minimises it.
if (frameworkWindowMode.Value == WindowMode.Fullscreen && frameworkMinimiseOnFocusLossInFullscreen.Value)
{
frameworkConfineMode.Value = ConfineMouseMode.Fullscreen;
return;