Skip to content

Conversation

@hsfzxjy
Copy link
Contributor

@hsfzxjy hsfzxjy commented Aug 21, 2023

fix #184155

This bug is caused by a subtle race conditon in SCMInputWidget.

When calling SCMInputWidget.focus(), it checks whether model data was set on the input and rejects to focus if not the case. (ref: https://github.com/microsoft/vscode/blob/main/src/vs/editor/browser/widget/codeEditorWidget.ts#L1424 )

Prior to commit f6e9a38 , setInput() was a sync method and it will finish before the first focus() would be called.

After that commit, however, setInput() was changed to an async method, and there's no guarantee that model data would be set before the first focus() being called.

This PR fixes the race condition and thus the issue.

@hsfzxjy hsfzxjy force-pushed the scm-no-focus-first-time-184155 branch from 6f58e15 to 5585845 Compare August 21, 2023 12:05
@lszomoru lszomoru added the scm General SCM compound issues label Aug 21, 2023
@lszomoru lszomoru added this to the August 2023 milestone Aug 21, 2023
@hsfzxjy hsfzxjy force-pushed the scm-no-focus-first-time-184155 branch 6 times, most recently from 483c5a7 to e9dfd54 Compare August 26, 2023 05:20
@hsfzxjy hsfzxjy force-pushed the scm-no-focus-first-time-184155 branch from e9dfd54 to 5ac0133 Compare August 29, 2023 04:21
@lszomoru lszomoru modified the milestones: August 2023, September 2023 Aug 30, 2023
@lszomoru lszomoru modified the milestones: September 2023, October 2023 Sep 26, 2023
@lszomoru lszomoru modified the milestones: October 2023, November 2023 Oct 23, 2023
@lszomoru lszomoru modified the milestones: November 2023, December 2023 Nov 27, 2023
@lszomoru lszomoru modified the milestones: December / January 2024, Backlog Jan 22, 2024
@lszomoru
Copy link
Member

@hsfzxjy, thank you very much for your contribution and apologies for not getting back to you on this until now. While the PR was correct at the time it was submitted, we have since moved to an async tree so your fix was not complete. I will close this PR in favour of #212580

@lszomoru lszomoru closed this May 13, 2024
@microsoft microsoft locked and limited conversation to collaborators Jun 27, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

scm General SCM compound issues

Projects

None yet

Development

Successfully merging this pull request may close these issues.

regression: ctrl+shift+g doesn't focus source control anymore when invoked for the first time

3 participants