X Tutup
Skip to content

Fix TabContainer set current tab not immediately updating visibility#117232

Open
kitbdev wants to merge 1 commit intogodotengine:masterfrom
kitbdev:fix-tabcontainer-change-tab-now
Open

Fix TabContainer set current tab not immediately updating visibility#117232
kitbdev wants to merge 1 commit intogodotengine:masterfrom
kitbdev:fix-tabcontainer-change-tab-now

Conversation

@kitbdev
Copy link
Contributor

@kitbdev kitbdev commented Mar 8, 2026

Fix TabContainer set current tab not immediately updating visibility

_on_tab_changed repaint was made deferred back in #58687, probably because repaint uses theme_cache which will crash if used too early. But now TabContainer::set_current_tab doesn't immediately set the current tab, it waits for NOTIFICATION_ENTER_TREE, since #83893.
This means it should be safe to repaint immediately when the tab changes.

I tested and didn't find any issues with it.

This also fixes the AnimationTree dock issue, because the TabContainer not being visible immediately caused this check to not work:

// if AnimationTree editor is visible, do not occupy the bottom panel
if (AnimationTreeEditor::get_singleton() && AnimationTreeEditor::get_singleton()->is_visible_in_tree()) {

Previously it was only possible to have the AnimationTree dock open automatically if the AnimationPlayer dock was already open. This was because this check in the dock manger never changed the tab to the AnimationPlayer dock because it detected that it was already visible since it didn't update yet to show the tree:

if (!p_dock->is_visible_in_tree()) {

Before that was a lot of dock manager changes, I haven't checked what made it work in 4.5.

EditorData::get_handling_sub_editors should probably be not in reverse order too, that way user plugins (and more specific plugins like AnimationTree) take priority over editor plugins, since they are opened in order and the last opened will override the others.
This was sort of even the goal with the PR that changed it #37022

@kitbdev kitbdev added this to the 4.7 milestone Mar 8, 2026
@kitbdev kitbdev requested a review from a team as a code owner March 8, 2026 20:59
@AThousandShips AThousandShips added the cherrypick:4.6 Considered for cherry-picking into a future 4.6.x release label Mar 9, 2026
@akien-mga
Copy link
Member

@dujanhung Please mention in your approvals what kind of review you've done. Did you review the code, test the changes, or are you simply communicating that you are interested in this change? If the latter, please use reactions on the OP instead, GitHub approvals should be left to code/design review and/or testing. See https://contributing.godotengine.org/en/latest/pull_requests/review_guidelines.html if you're interested in reviewing PRs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug cherrypick:4.6 Considered for cherry-picking into a future 4.6.x release regression topic:editor topic:gui

Projects

None yet

Development

Successfully merging this pull request may close these issues.

AnimationTree trigger Animation panel instead AnimationTree panel Setting TabContainer.current_tab doesn't immediately change visibility

6 participants

X Tutup