mirror of
https://github.com/ppy/osu.git
synced 2024-11-13 16:13:34 +08:00
Override confine mouse mode only when clicking outside the window would minimise it
This commit is contained in:
parent
c9de6a383d
commit
0fde9cd6ae
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user