virtualx-engine/scene
Rémi Verschelde fd6453c45e Revert "Remove NOTIFICATION_ENTER_TREE when paired with NOTIFICATION_THEME_CHANGED"
This reverts commit 4b817a565c.

Fixes #64988.
Fixes #64997.

This caused several regressions (#64988, #64997,
https://github.com/godotengine/godot/issues/64997#issuecomment-1229970605)
which point at a flaw in the current logic:

- `Control::NOTIFICATION_ENTER_TREE` triggers a *deferred* notification with
  `NOTIFCATION_THEME_CHANGED` as introduced in #62845.
- Some classes use their `THEME_CHANGED` to cache theme items in
  member variables (e.g. `style_normal`, etc.), and use those member
  variables in `ENTER_TREE`, `READY`, `DRAW`, etc. Since the `THEME_CHANGE`
  notification is now deferred, they end up accessing invalid state and this
  can lead to not applying theme properly (e.g. for EditorHelp) or crashing
  (e.g. for EditorLog or CodeEdit).

So we need to go back to the drawing board and see if `THEME_CHANGED` can be
called earlier so that the previous logic still works?

Or can we refactor all engine code to make sure that:
- `ENTER_TREE` and similar do not depend on theme properties cached in member
  variables.
- Or `THEME_CHANGE` does trigger a general UI update to make sure that any
  bad theme handling in `ENTER_TREE` and co. gets fixed when `THEME_CHANGE`
  does arrive for the first time. But that means having a temporary invalid
  (and possibly still crashing) state, and doing some computations twice
  which might be heavy (e.g. `EditorHelp::_update_doc()`).
2022-08-29 11:11:29 +02:00
..
2d Merge pull request #64367 from Mickeon/rename-var-to-str 2022-08-26 23:04:06 +02:00
3d Merge pull request #64367 from Mickeon/rename-var-to-str 2022-08-26 23:04:06 +02:00
animation Improve documentation for get_animation() 2022-08-29 14:54:57 +08:00
audio Rename str2var to str_to_var and similar 2022-08-26 14:58:22 +02:00
debugger Swap arguments of ResourceSaver.save() 2022-07-29 19:53:09 +02:00
gui Revert "Remove NOTIFICATION_ENTER_TREE when paired with NOTIFICATION_THEME_CHANGED" 2022-08-29 11:11:29 +02:00
main Revert "Remove NOTIFICATION_ENTER_TREE when paired with NOTIFICATION_THEME_CHANGED" 2022-08-29 11:11:29 +02:00
resources Improve documentation for get_animation() 2022-08-29 14:54:57 +08:00
property_utils.cpp Cleanup and move char functions to the char_utils.h header. 2022-02-04 11:35:01 +02:00
property_utils.h Update copyright statements to 2022 2022-01-03 21:27:34 +01:00
register_scene_types.cpp Implement custom non-trivial shader functions 2022-08-27 22:59:12 +02:00
register_scene_types.h Code quality: Fix header guards consistency 2022-07-25 11:17:40 +02:00
scene_string_names.cpp Update copyright statements to 2022 2022-01-03 21:27:34 +01:00
scene_string_names.h Update copyright statements to 2022 2022-01-03 21:27:34 +01:00
SCsub [Net] Modularize multiplayer, expose MultiplayerAPI to extensions. 2022-07-26 09:31:12 +02:00