1
0
mirror of https://github.com/ppy/osu.git synced 2026-05-26 06:49:54 +08:00

Update focus handling in line with framework changes

This commit is contained in:
Dean Herbert
2017-05-28 20:08:46 +09:00
Unverified
parent bdeaf2dbb4
commit d749fc516d
8 changed files with 42 additions and 18 deletions
@@ -3,6 +3,7 @@
using OpenTK.Graphics;
using OpenTK.Input;
using osu.Framework.Allocation;
using osu.Framework.Input;
using System;
using System.Linq;
@@ -23,11 +24,19 @@ namespace osu.Game.Graphics.UserInterface
set
{
focus = value;
if (!focus)
TriggerFocusLost();
if (!focus && HasFocus)
inputManager.ChangeFocus(null);
}
}
private InputManager inputManager;
[BackgroundDependencyLoader]
private void load(UserInputManager inputManager)
{
this.inputManager = inputManager;
}
protected override bool OnFocus(InputState state)
{
var result = base.OnFocus(state);