From dc55c4aa83a3307c6d1026876b3126f1991a8a2e Mon Sep 17 00:00:00 2001 From: Anthony Yakovlev Date: Wed, 6 Aug 2025 19:28:38 +0300 Subject: [PATCH 1/4] remove unused private variables --- .../InputSystem/Editor/ControlPicker/InputControlPathEditor.cs | 3 --- .../UITKAssetEditor/InputActionsEditorSettingsProvider.cs | 1 - 2 files changed, 4 deletions(-) diff --git a/Packages/com.unity.inputsystem/InputSystem/Editor/ControlPicker/InputControlPathEditor.cs b/Packages/com.unity.inputsystem/InputSystem/Editor/ControlPicker/InputControlPathEditor.cs index 91d10fdc81..09db1fcc4a 100644 --- a/Packages/com.unity.inputsystem/InputSystem/Editor/ControlPicker/InputControlPathEditor.cs +++ b/Packages/com.unity.inputsystem/InputSystem/Editor/ControlPicker/InputControlPathEditor.cs @@ -206,12 +206,9 @@ private void SetExpectedControlLayoutFromAttribute(SerializedProperty property) private GUIContent m_PathLabel; private string m_ExpectedControlLayout; private string[] m_ControlPathsToMatch; - private InputControlScheme[] m_ControlSchemes; - private bool m_NeedToClearProgressBar; private InputControlPickerDropdown m_PickerDropdown; private readonly InputControlPickerState m_PickerState; - private InputActionRebindingExtensions.RebindingOperation m_RebindingOperation; } } #endif // UNITY_EDITOR diff --git a/Packages/com.unity.inputsystem/InputSystem/Editor/UITKAssetEditor/InputActionsEditorSettingsProvider.cs b/Packages/com.unity.inputsystem/InputSystem/Editor/UITKAssetEditor/InputActionsEditorSettingsProvider.cs index 3ff81719c3..da4ba2e8dd 100644 --- a/Packages/com.unity.inputsystem/InputSystem/Editor/UITKAssetEditor/InputActionsEditorSettingsProvider.cs +++ b/Packages/com.unity.inputsystem/InputSystem/Editor/UITKAssetEditor/InputActionsEditorSettingsProvider.cs @@ -17,7 +17,6 @@ internal class InputActionsEditorSettingsProvider : SettingsProvider [SerializeField] InputActionsEditorState m_State; VisualElement m_RootVisualElement; private bool m_HasEditFocus; - private bool m_IgnoreActionChangedCallback; private bool m_IsActivated; private static bool m_IMGUIDropdownVisible; StateContainer m_StateContainer; From 387c1e2bfd679847456d2a9e685643cb0bdeb211 Mon Sep 17 00:00:00 2001 From: Anthony Yakovlev Date: Wed, 6 Aug 2025 19:29:36 +0300 Subject: [PATCH 2/4] fix up the input control picker sometimes not applying the values --- .../ControlPicker/InputControlPathEditor.cs | 15 +++++++++++++-- .../UITKAssetEditor/InputActionsEditorWindow.cs | 7 ++++++- 2 files changed, 19 insertions(+), 3 deletions(-) diff --git a/Packages/com.unity.inputsystem/InputSystem/Editor/ControlPicker/InputControlPathEditor.cs b/Packages/com.unity.inputsystem/InputSystem/Editor/ControlPicker/InputControlPathEditor.cs index 09db1fcc4a..7876f9f886 100644 --- a/Packages/com.unity.inputsystem/InputSystem/Editor/ControlPicker/InputControlPathEditor.cs +++ b/Packages/com.unity.inputsystem/InputSystem/Editor/ControlPicker/InputControlPathEditor.cs @@ -161,9 +161,11 @@ public void OnGUI(Rect rect, GUIContent label = null, SerializedProperty propert private void ShowDropdown(Rect rect, SerializedProperty serializedProperty, Action modifiedCallback) { - #if UNITY_INPUT_SYSTEM_PROJECT_WIDE_ACTIONS +#if UNITY_INPUT_SYSTEM_PROJECT_WIDE_ACTIONS InputActionsEditorSettingsProvider.SetIMGUIDropdownVisible(true, false); - #endif +#endif + IsShowingDropdown = true; + if (m_PickerDropdown == null) { m_PickerDropdown = new InputControlPickerDropdown( @@ -187,6 +189,8 @@ private void ShowDropdown(Rect rect, SerializedProperty serializedProperty, Acti m_PickerDropdown.SetExpectedControlLayout(m_ExpectedControlLayout); m_PickerDropdown.Show(rect); + + IsShowingDropdown = false; } private void SetExpectedControlLayoutFromAttribute(SerializedProperty property) @@ -209,6 +213,13 @@ private void SetExpectedControlLayoutFromAttribute(SerializedProperty property) private InputControlPickerDropdown m_PickerDropdown; private readonly InputControlPickerState m_PickerState; + + /// + /// This property is only set from this class in order to communicate that we're showing the dropdown at the moment + /// It's employed to skip auto-saving, because that complicates updating the internal SerializedProperties. + /// Unfortunately, we can't use IMGUIDropdownVisible from the setings provider because of the early-out logic in there. + /// + public static bool IsShowingDropdown { get; private set; } } } #endif // UNITY_EDITOR diff --git a/Packages/com.unity.inputsystem/InputSystem/Editor/UITKAssetEditor/InputActionsEditorWindow.cs b/Packages/com.unity.inputsystem/InputSystem/Editor/UITKAssetEditor/InputActionsEditorWindow.cs index 0928f3c819..d469d1e8e5 100644 --- a/Packages/com.unity.inputsystem/InputSystem/Editor/UITKAssetEditor/InputActionsEditorWindow.cs +++ b/Packages/com.unity.inputsystem/InputSystem/Editor/UITKAssetEditor/InputActionsEditorWindow.cs @@ -344,7 +344,12 @@ private void OnLostFocus() // Auto-save triggers on focus-lost instead of on every change #if UNITY_INPUT_SYSTEM_INPUT_ACTIONS_EDITOR_AUTO_SAVE_ON_FOCUS_LOST if (InputEditorUserSettings.autoSaveInputActionAssets && m_IsDirty) - Save(isAutoSave: true); + // We'd like to avoid saving in case the focus was lost due to the drop-down window being spawned. + // This code should be cleaned up once we migrate the InputControl stuff from ImGUI completely. + // Since at that point it stops being a separate window that steals focus. + // (See case ISXB-1221) + if (!InputControlPathEditor.IsShowingDropdown) + Save(isAutoSave: true); #endif analytics.RegisterEditorFocusOut(); From 62b73c0ca0ec341f7d7c88552b0dc2d361b413f8 Mon Sep 17 00:00:00 2001 From: Anthony Yakovlev Date: Thu, 7 Aug 2025 11:56:39 +0300 Subject: [PATCH 3/4] apply formatting --- .../InputSystem/Editor/ControlPicker/InputControlPathEditor.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Packages/com.unity.inputsystem/InputSystem/Editor/ControlPicker/InputControlPathEditor.cs b/Packages/com.unity.inputsystem/InputSystem/Editor/ControlPicker/InputControlPathEditor.cs index 7876f9f886..a986c2c2b3 100644 --- a/Packages/com.unity.inputsystem/InputSystem/Editor/ControlPicker/InputControlPathEditor.cs +++ b/Packages/com.unity.inputsystem/InputSystem/Editor/ControlPicker/InputControlPathEditor.cs @@ -217,7 +217,7 @@ private void SetExpectedControlLayoutFromAttribute(SerializedProperty property) /// /// This property is only set from this class in order to communicate that we're showing the dropdown at the moment /// It's employed to skip auto-saving, because that complicates updating the internal SerializedProperties. - /// Unfortunately, we can't use IMGUIDropdownVisible from the setings provider because of the early-out logic in there. + /// Unfortunately, we can't use IMGUIDropdownVisible from the setings provider because of the early-out logic in there. /// public static bool IsShowingDropdown { get; private set; } } From f38d3ae0a37021f8c35a31691cd066ccf124da41 Mon Sep 17 00:00:00 2001 From: Anthony Yakovlev Date: Thu, 7 Aug 2025 11:59:47 +0300 Subject: [PATCH 4/4] update changelog --- Packages/com.unity.inputsystem/CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/Packages/com.unity.inputsystem/CHANGELOG.md b/Packages/com.unity.inputsystem/CHANGELOG.md index 5d522c7ffd..dd43bc44f4 100644 --- a/Packages/com.unity.inputsystem/CHANGELOG.md +++ b/Packages/com.unity.inputsystem/CHANGELOG.md @@ -9,6 +9,7 @@ Due to package verification, the latest version below is the unpublished version however, it has to be formatted properly to pass verification tests. ## [Unreleased] - yyyy-mm-dd +- Fixed InputControl picker not updating correctly when the Input Actions Window was dirty. [ISXB-1221](https://issuetracker.unity3d.com/product/unity/issues/guid/ISXB-1221) ### Added - Exposed MediaPlayPause, MediaRewind, MediaForward keys on Keyboard.