Skip to content

Commit c56a5ae

Browse files
authored
Merge branch 'develop' into wind/test_ubuntu_standalone_il2cpp
2 parents 89c53f9 + 28b42c1 commit c56a5ae

File tree

4 files changed

+20
-7
lines changed

4 files changed

+20
-7
lines changed

Packages/com.unity.inputsystem/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ Due to package verification, the latest version below is the unpublished version
99
however, it has to be formatted properly to pass verification tests.
1010

1111
## [Unreleased] - yyyy-mm-dd
12+
- 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)
1213

1314
### Added
1415
- Exposed MediaPlayPause, MediaRewind, MediaForward keys on Keyboard.

Packages/com.unity.inputsystem/InputSystem/Editor/ControlPicker/InputControlPathEditor.cs

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -161,9 +161,11 @@ public void OnGUI(Rect rect, GUIContent label = null, SerializedProperty propert
161161

162162
private void ShowDropdown(Rect rect, SerializedProperty serializedProperty, Action modifiedCallback)
163163
{
164-
#if UNITY_INPUT_SYSTEM_PROJECT_WIDE_ACTIONS
164+
#if UNITY_INPUT_SYSTEM_PROJECT_WIDE_ACTIONS
165165
InputActionsEditorSettingsProvider.SetIMGUIDropdownVisible(true, false);
166-
#endif
166+
#endif
167+
IsShowingDropdown = true;
168+
167169
if (m_PickerDropdown == null)
168170
{
169171
m_PickerDropdown = new InputControlPickerDropdown(
@@ -187,6 +189,8 @@ private void ShowDropdown(Rect rect, SerializedProperty serializedProperty, Acti
187189
m_PickerDropdown.SetExpectedControlLayout(m_ExpectedControlLayout);
188190

189191
m_PickerDropdown.Show(rect);
192+
193+
IsShowingDropdown = false;
190194
}
191195

192196
private void SetExpectedControlLayoutFromAttribute(SerializedProperty property)
@@ -206,12 +210,16 @@ private void SetExpectedControlLayoutFromAttribute(SerializedProperty property)
206210
private GUIContent m_PathLabel;
207211
private string m_ExpectedControlLayout;
208212
private string[] m_ControlPathsToMatch;
209-
private InputControlScheme[] m_ControlSchemes;
210-
private bool m_NeedToClearProgressBar;
211213

212214
private InputControlPickerDropdown m_PickerDropdown;
213215
private readonly InputControlPickerState m_PickerState;
214-
private InputActionRebindingExtensions.RebindingOperation m_RebindingOperation;
216+
217+
/// <summary>
218+
/// This property is only set from this class in order to communicate that we're showing the dropdown at the moment
219+
/// It's employed to skip auto-saving, because that complicates updating the internal SerializedProperties.
220+
/// Unfortunately, we can't use IMGUIDropdownVisible from the setings provider because of the early-out logic in there.
221+
/// </summary>
222+
internal static bool IsShowingDropdown { get; private set; }
215223
}
216224
}
217225
#endif // UNITY_EDITOR

Packages/com.unity.inputsystem/InputSystem/Editor/UITKAssetEditor/InputActionsEditorSettingsProvider.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ internal class InputActionsEditorSettingsProvider : SettingsProvider
1717
[SerializeField] InputActionsEditorState m_State;
1818
VisualElement m_RootVisualElement;
1919
private bool m_HasEditFocus;
20-
private bool m_IgnoreActionChangedCallback;
2120
private bool m_IsActivated;
2221
private static bool m_IMGUIDropdownVisible;
2322
StateContainer m_StateContainer;

Packages/com.unity.inputsystem/InputSystem/Editor/UITKAssetEditor/InputActionsEditorWindow.cs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -344,7 +344,12 @@ private void OnLostFocus()
344344
// Auto-save triggers on focus-lost instead of on every change
345345
#if UNITY_INPUT_SYSTEM_INPUT_ACTIONS_EDITOR_AUTO_SAVE_ON_FOCUS_LOST
346346
if (InputEditorUserSettings.autoSaveInputActionAssets && m_IsDirty)
347-
Save(isAutoSave: true);
347+
// We'd like to avoid saving in case the focus was lost due to the drop-down window being spawned.
348+
// This code should be cleaned up once we migrate the InputControl stuff from ImGUI completely.
349+
// Since at that point it stops being a separate window that steals focus.
350+
// (See case ISXB-1221)
351+
if (!InputControlPathEditor.IsShowingDropdown)
352+
Save(isAutoSave: true);
348353
#endif
349354

350355
analytics.RegisterEditorFocusOut();

0 commit comments

Comments
 (0)