fix: guard GrabFirstFocus on pointerless, unsub VisibilityChanged in _ExitTree
This commit is contained in:
@@ -36,6 +36,7 @@ public partial class AudioSettings : Control
|
|||||||
{
|
{
|
||||||
if (InputDeviceManager.Instance != null)
|
if (InputDeviceManager.Instance != null)
|
||||||
InputDeviceManager.Instance.DeviceChanged -= OnDeviceChanged;
|
InputDeviceManager.Instance.DeviceChanged -= OnDeviceChanged;
|
||||||
|
AudioSettingsControl.VisibilityChanged -= OnVisibilityChanged;
|
||||||
SaveSettings();
|
SaveSettings();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -40,6 +40,7 @@ public partial class MainMenu : Control
|
|||||||
InputDeviceManager.Instance.DeviceChanged += OnDeviceChanged;
|
InputDeviceManager.Instance.DeviceChanged += OnDeviceChanged;
|
||||||
VisibilityChanged += OnVisibilityChanged;
|
VisibilityChanged += OnVisibilityChanged;
|
||||||
|
|
||||||
|
if (InputDeviceManager.Instance?.IsPointerless == true)
|
||||||
GrabFirstFocus();
|
GrabFirstFocus();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -39,6 +39,7 @@ public partial class PauseMenu : Control
|
|||||||
{
|
{
|
||||||
if (InputDeviceManager.Instance != null)
|
if (InputDeviceManager.Instance != null)
|
||||||
InputDeviceManager.Instance.DeviceChanged -= OnDeviceChanged;
|
InputDeviceManager.Instance.DeviceChanged -= OnDeviceChanged;
|
||||||
|
PauseMenuControl.VisibilityChanged -= OnVisibilityChanged;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void OnVisibilityChanged()
|
private void OnVisibilityChanged()
|
||||||
|
|||||||
Reference in New Issue
Block a user