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 clear_custom_color on invalid tree_item_inspected pointer #99122

Conversation

AeioMuch
Copy link
Contributor

@AeioMuch AeioMuch commented Nov 12, 2024

Fixes #99111

In #96124 I centralized the code inside NOTIFICATION_DRAG_END, which changed the order of operation causing a bug similar to (#93565) to resurface and preventing the earlier fix (#93576) to stay effective.

Now I store the inspected & highlighted item as Node * then retrieve the tree item from it, instead of storing it directly as TreeItem * which could become invalid if the tree order was modified.

@AeioMuch AeioMuch requested a review from a team as a code owner November 12, 2024 12:44
@AThousandShips AThousandShips changed the title Fix clear_custom_color on invalid tree_item_inspected pointer #2 Fix clear_custom_color on invalid tree_item_inspected pointer Nov 12, 2024
@Rindbee
Copy link
Contributor

Rindbee commented Nov 12, 2024

At the end of the drag and drop, the tree structure either changed or it didn't.
We only need to clear the item color if the tree structure didn't change, because the tree is rebuilt when the tree structure changes.

@akien-mga akien-mga added this to the 4.4 milestone Nov 12, 2024
@AeioMuch AeioMuch closed this Dec 23, 2024
@AeioMuch AeioMuch deleted the fix_clear_custom_color_invalid_pointer_round_2 branch December 23, 2024 19:28
@AThousandShips AThousandShips removed this from the 4.4 milestone Dec 23, 2024
@KoBeWi
Copy link
Member

KoBeWi commented Dec 23, 2024

Superseded by #99700

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.

Dragging and dropping node(s) in the Scene dock may cause error message
5 participants