godot/scene
aaronp64 5a25637ca9 Fix Container::pending_sort tracking
When Container::queue_sort() is called, pending_sort is set to true to indicate when a call to _sort_children() is queued, to avoid queueing multiple calls. Container::_sort_children() sets pending_sort back to false when finished, but did not do this when the container was not inside the tree.  This would allow cases where queue_sort() could be called just before removing from the tree, causing _sort_children() to never reset pending_sort, preventing any future queue_sort() calls from queueing again.

One case where this happened was with the "Saving Scene" progress bar in the editor - when saving for the first time (or the first time the progress bar popup otherwise appeared in the editor), _sort_children() would be called successfully.  After the progress bar popup was hidden, then shown again on future saves, _sort_children() would not be called again, resulting in the progress bar not taking up as much space as it should.

This issue used to be avoided by setting pending_sort to false immediately on NOTIFICATION_ENTER_TREE - however, this would allow multiple calls to be queued at the same time when entering the tree (#92644).  The multiple calls was fixed recently by removing this assignment, but this also made possible the case where pending_sort is never reset.

This change sets pending_sort back to false in _sort_children() whether or not it's in the tree.  Since this is done in a deferred call, it should still avoid the previous issue of multiple calls being queued at once on entering the tree.

Fixes #92971
2024-06-10 20:17:47 -04:00
..
2d Implement X-draw-order switch in TileMapLayer 2024-06-10 15:53:58 +02:00
3d Merge pull request #92925 from TokageItLab/concatenated-bone-names 2024-06-10 16:12:08 +02:00
animation Fix seeking Animation immediate after playback for Discrete track 2024-06-08 22:09:37 +09:00
audio Use Core/Scene stringnames consistently 2024-05-13 23:41:07 +02:00
debugger Reduce and prevent unnecessary random-access to List 2024-05-04 16:08:55 +02:00
gui Fix Container::pending_sort tracking 2024-06-10 20:17:47 -04:00
main Merge pull request #91997 from aaronp64/tooltip_transforms 2024-06-10 16:11:39 +02:00
resources Merge pull request #92861 from TokageItLab/fix-animation-player-just-after-started 2024-06-10 16:11:55 +02:00
theme Merge pull request #91953 from AThousandShips/use_normal_sname 2024-05-31 14:16:05 +02:00
property_list_helper.cpp Automatically use property count in PropertyListHelper 2024-05-25 10:51:37 +02:00
property_list_helper.h Automatically use property count in PropertyListHelper 2024-05-25 10:51:37 +02:00
property_utils.cpp Fix default NodePaths saved in scene 2024-06-03 13:10:23 +02:00
property_utils.h Fix default NodePaths saved in scene 2024-06-03 13:10:23 +02:00
register_scene_types.cpp Use Core/Scene stringnames consistently 2024-05-13 23:41:07 +02:00
register_scene_types.h One Copyright Update to rule them all 2023-01-05 13:25:55 +01:00
scene_string_names.cpp [Scene] Add SceneStringNames::panel 2024-05-30 22:54:50 +02:00
scene_string_names.h [Scene] Add SceneStringNames::panel 2024-05-30 22:54:50 +02:00
SCsub Add ThemeDB, expose previously static Theme methods 2022-08-26 19:23:05 +03:00