-
-
Notifications
You must be signed in to change notification settings - Fork 21.4k
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 saving wrong edited scene state when switching scene tabs #83251
Fix saving wrong edited scene state when switching scene tabs #83251
Conversation
bb0122f
to
f652dfe
Compare
It doesn't seem to fix the linked issue, the scene tree is still getting empty. |
Is it the same way to reproduce? 0.mp4 |
I'm getting different results in the first case 🤔 godot.windows.editor.dev.x86_64_rNIjV7CZGH.mp4EDIT: |
I still can't reproduce it, maybe due to some non-default editor settings? (I deleted the config, cache and data directories) 1.mp4 |
I tried in a fresh project in self-contained mode and still get the bug. |
Ok I think I got the steps more or less:
|
f652dfe
to
80d60cd
Compare
It seems that when |
Seems like a regression from #80517 then? So my main concern is whether this introduces some excessive calls again. My question would be whether we need to do it to every scene, or just the last one that becomes active. |
We need to do it to every scene, #83251 (comment) can be reproduced in all open scenes (as long as no nodes are selected). |
I see. So something else expects every open scene to be in the history, even if the user never navigated to them. I think it's worth adding a comment to the else clause to explain that. |
c7c07f8
to
685d107
Compare
When creating a new scene, the scene tab will actually switch to the newly created one. Also worth noting that switching scene tabs saves state (by `save_edited_scene_state`). When trying New Scene again, the previously empty scene tab will be removed. So the correct logic is: switch the tab save state first, and then remove the previous empty scene tab. To prevent `current_edited_scene` from being incorrect when saving state.
685d107
to
225a5e2
Compare
Thanks! |
When creating a new scene, the scene tab will actually switch to the newly created one. Also worth noting that switching scene tabs saves state (by
save_edited_scene_state
).When trying New Scene again, the previously empty scene tab will be removed.
So the correct logic is: switch the tab save state first, and then remove the previous empty scene tab. To prevent
current_edited_scene
from being incorrect when saving state.Fix #83213.