Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix out of sync ScriptEditor distraction mode when Separate Distraction Mode is Enabled #48834

Conversation

daniel-mcclintock
Copy link
Contributor

Fixes an issue where the Script Editor's distraction state can get out of sync.

This happens when Separate Distraction Mode is enabled, distraction-free mode is active on the Script Editor, the user switches to a 2D or 3D Scene Editor and clicks a SceneTree Node's Edit Script button.

Click to see the issue in action

distraction-free-mode-out-of-sync

@daniel-mcclintock daniel-mcclintock requested a review from a team as a code owner May 19, 2021 10:38
@YuriSizov YuriSizov added this to the 4.0 milestone May 19, 2021
@YuriSizov YuriSizov added the cherrypick:3.x Considered for cherry-picking into a future 3.x release label May 19, 2021
Copy link
Member

@Paulb23 Paulb23 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure if this is the correct fix, it looks like _edit_current should call _editor_select rather then it re-implementing the switching code.

@daniel-mcclintock
Copy link
Contributor Author

@Paulb23 I have had a look at those two functions and can see what you mean. Thanks for putting me in the right direction. I will rework this to be as you suggest.

@daniel-mcclintock
Copy link
Contributor Author

daniel-mcclintock commented Jun 8, 2021

@Paulb23 I have updated this. Let me know if I have missed anything.

Copy link
Member

@Paulb23 Paulb23 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the contribution!

LGTM.

editor/editor_node.cpp Outdated Show resolved Hide resolved
@akien-mga akien-mga merged commit f178e7a into godotengine:master Jun 9, 2021
@akien-mga
Copy link
Member

Thanks!

@daniel-mcclintock daniel-mcclintock deleted the fix-distraction-free-state-loss branch June 10, 2021 02:26
@akien-mga
Copy link
Member

Cherry-picked for 3.4.

@akien-mga akien-mga removed the cherrypick:3.x Considered for cherry-picking into a future 3.x release label Jun 17, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants