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

[4.3] Cherry-picks for the 4.3 (4.3.1) branch - 1st regressions batch #929

Merged
merged 31 commits into from
Jan 18, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
42c5681
Autocompletion: Keep get_node values which are compatible with type hint
HolonProduction May 22, 2024
b7d3d62
Fix graph node sizing regression, improve blend tree contrast/margins
ckaiser Jul 21, 2024
922c3e0
Don't fold resources when child of main inspector exits
KoBeWi Aug 4, 2024
c370287
Fix `InputMap::event_get_index` to handle unmatched events correctly
Aug 18, 2024
efc7a8c
Fix Inspector may scrolls away when editing a property that adds or r…
Maran23 Sep 3, 2024
ad4d6e0
Fix EditorSpinSlider blocking viewport from getting focus
passivestar Sep 10, 2024
4711509
[RTL] Expose missing default properties, ensure bbcode is reparserd w…
bruvzg Jul 16, 2024
8a5177b
Fix `RichTextLabel`'s modified stack being wiped on translation changes
YeldhamDev Sep 15, 2024
9ce1221
Add forgotten `get_space()` check in `GodotArea3D::remove_soft_body_f…
Rindbee Sep 17, 2024
494548b
Fix Undo/Redo not working in Bezier Animation Editor when moving keys
Dowsley Sep 18, 2024
a87922e
Fix TabBar initialization issue and add tests
kitbdev Sep 20, 2024
cce93e2
Fix crash when importing a surface with no UVs after another surface …
clayjohn Sep 21, 2024
72284fd
Fix physics platform behaviour regression
lawnjelly Sep 22, 2024
0646309
Clean up two recently introduced WebGL errors
clayjohn Sep 23, 2024
de67044
Fix editing of some properties in `CodeHighlighter`
AThousandShips Sep 24, 2024
c996169
Fix ItemList text trimming and autowrap margin
havi05 Sep 25, 2024
0424460
Fix renaming nodes on X11
dsnopek Sep 25, 2024
407e315
GDScript: Fix `GDScriptCache::get_full_script()` uses non-remapped path
dalexeev Oct 3, 2024
e3fa70c
[GraphEdit] Only print warning for connection layer deletion when jus…
Geometror Oct 4, 2024
d4e026f
Restore arc_tolerance value when using Clipper2's InflatePaths
rburing Oct 9, 2024
7f678fd
Account for physics interpolation and transform snapping when Y-sorting
kleonc Sep 5, 2024
3ddb963
Don't recalculate final render transforms for Y-sorted canvas items
kleonc Sep 5, 2024
2b1e6c0
Revert incorrect rounding when 2D transform snapping
kleonc Oct 15, 2024
d49e942
[Scene] Add SceneStringName::toggled
Chaosus Jun 1, 2024
e5f75f6
Improve editor file dialog options
timoschwarzer Nov 13, 2024
550d4a9
Fix removing last digit in spinbox while update_on_text_changed is true
ryevdokimov Nov 26, 2024
a784652
Don't navigate to path when file is double-clicked
KoBeWi Dec 4, 2024
558f04c
Correctly check time since shadow was allocated in atlas to avoid unn…
clayjohn Dec 5, 2024
81159dc
Increase precision in linear_to_srgb and srgb_to_linear
clayjohn Dec 20, 2024
cba0e0b
Fix root window size bug on Android
syntaxerror247 Nov 25, 2024
e642fb4
Fix Window size changes ignored on Android
syntaxerror247 Dec 22, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions core/input/input_map.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -255,8 +255,8 @@ bool InputMap::event_is_action(const Ref<InputEvent> &p_event, const StringName

int InputMap::event_get_index(const Ref<InputEvent> &p_event, const StringName &p_action, bool p_exact_match) const {
int index = -1;
event_get_action_status(p_event, p_action, p_exact_match, nullptr, nullptr, nullptr, &index);
return index;
bool valid = event_get_action_status(p_event, p_action, p_exact_match, nullptr, nullptr, nullptr, &index);
return valid ? index : -1;
}

bool InputMap::event_get_action_status(const Ref<InputEvent> &p_event, const StringName &p_action, bool p_exact_match, bool *r_pressed, float *r_strength, float *r_raw_strength, int *r_event_index) const {
Expand Down
12 changes: 6 additions & 6 deletions core/math/color.h
Original file line number Diff line number Diff line change
Expand Up @@ -176,16 +176,16 @@ struct [[nodiscard]] Color {

_FORCE_INLINE_ Color srgb_to_linear() const {
return Color(
r < 0.04045f ? r * (1.0f / 12.92f) : Math::pow((r + 0.055f) * (float)(1.0 / (1.0 + 0.055)), 2.4f),
g < 0.04045f ? g * (1.0f / 12.92f) : Math::pow((g + 0.055f) * (float)(1.0 / (1.0 + 0.055)), 2.4f),
b < 0.04045f ? b * (1.0f / 12.92f) : Math::pow((b + 0.055f) * (float)(1.0 / (1.0 + 0.055)), 2.4f),
r < 0.04045f ? r * (1.0f / 12.92f) : Math::pow(float((r + 0.055) * (1.0 / (1.0 + 0.055))), 2.4f),
g < 0.04045f ? g * (1.0f / 12.92f) : Math::pow(float((g + 0.055) * (1.0 / (1.0 + 0.055))), 2.4f),
b < 0.04045f ? b * (1.0f / 12.92f) : Math::pow(float((b + 0.055) * (1.0 / (1.0 + 0.055))), 2.4f),
a);
}
_FORCE_INLINE_ Color linear_to_srgb() const {
return Color(
r < 0.0031308f ? 12.92f * r : (1.0f + 0.055f) * Math::pow(r, 1.0f / 2.4f) - 0.055f,
g < 0.0031308f ? 12.92f * g : (1.0f + 0.055f) * Math::pow(g, 1.0f / 2.4f) - 0.055f,
b < 0.0031308f ? 12.92f * b : (1.0f + 0.055f) * Math::pow(b, 1.0f / 2.4f) - 0.055f, a);
r < 0.0031308f ? 12.92f * r : (1.0 + 0.055) * Math::pow(r, 1.0f / 2.4f) - 0.055,
g < 0.0031308f ? 12.92f * g : (1.0 + 0.055) * Math::pow(g, 1.0f / 2.4f) - 0.055,
b < 0.0031308f ? 12.92f * b : (1.0 + 0.055) * Math::pow(b, 1.0f / 2.4f) - 0.055, a);
}

static Color hex(uint32_t p_hex);
Expand Down
12 changes: 7 additions & 5 deletions core/math/geometry_2d.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,8 @@
#define STB_RECT_PACK_IMPLEMENTATION
#include "thirdparty/misc/stb_rect_pack.h"

#define PRECISION 5 // Based on CMP_EPSILON.
const int clipper_precision = 5; // Based on CMP_EPSILON.
const double clipper_scale = Math::pow(10.0, clipper_precision);

Vector<Vector<Vector2>> Geometry2D::decompose_polygon_in_convex(const Vector<Point2> &polygon) {
Vector<Vector<Vector2>> decomp;
Expand Down Expand Up @@ -226,7 +227,7 @@ Vector<Vector<Point2>> Geometry2D::_polypaths_do_operation(PolyBooleanOperation
path_b[i] = PointD(p_polypath_b[i].x, p_polypath_b[i].y);
}

ClipperD clp(PRECISION); // Scale points up internally to attain the desired precision.
ClipperD clp(clipper_precision); // Scale points up internally to attain the desired precision.
clp.PreserveCollinear(false); // Remove redundant vertices.
if (is_a_open) {
clp.AddOpenSubject({ path_a });
Expand Down Expand Up @@ -300,9 +301,10 @@ Vector<Vector<Point2>> Geometry2D::_polypath_offset(const Vector<Point2> &p_poly
}

// Inflate/deflate.
PathsD paths = InflatePaths({ polypath }, p_delta, jt, et, 2.0, PRECISION, 0.0);
// Here the miter_limit = 2.0 and arc_tolerance = 0.0 are Clipper2 defaults,
// and the PRECISION is used to scale points up internally, to attain the desired precision.
PathsD paths = InflatePaths({ polypath }, p_delta, jt, et, 2.0, clipper_precision, 0.25 * clipper_scale);
// Here the points are scaled up internally and
// the arc_tolerance is scaled accordingly
// to attain the desired precision.

Vector<Vector<Point2>> polypaths;
for (PathsD::size_type i = 0; i < paths.size(); ++i) {
Expand Down
1 change: 1 addition & 0 deletions doc/classes/EditorInspector.xml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
</method>
</methods>
<members>
<member name="follow_focus" type="bool" setter="set_follow_focus" getter="is_following_focus" overrides="ScrollContainer" default="true" />
<member name="horizontal_scroll_mode" type="int" setter="set_horizontal_scroll_mode" getter="get_horizontal_scroll_mode" overrides="ScrollContainer" enum="ScrollContainer.ScrollMode" default="0" />
</members>
<signals>
Expand Down
2 changes: 1 addition & 1 deletion doc/classes/Label.xml
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
Controls the text's horizontal alignment. Supports left, center, right, and fill, or justify. Set it to one of the [enum HorizontalAlignment] constants.
</member>
<member name="justification_flags" type="int" setter="set_justification_flags" getter="get_justification_flags" enum="TextServer.JustificationFlag" is_bitfield="true" default="163">
Line fill alignment rules. For more info see [enum TextServer.JustificationFlag].
Line fill alignment rules. See [enum TextServer.JustificationFlag] for more information.
</member>
<member name="label_settings" type="LabelSettings" setter="set_label_settings" getter="get_label_settings">
A [LabelSettings] resource that can be shared between multiple [Label] nodes. Takes priority over theme properties.
Expand Down
2 changes: 1 addition & 1 deletion doc/classes/Label3D.xml
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@
Controls the text's horizontal alignment. Supports left, center, right, and fill, or justify. Set it to one of the [enum HorizontalAlignment] constants.
</member>
<member name="justification_flags" type="int" setter="set_justification_flags" getter="get_justification_flags" enum="TextServer.JustificationFlag" is_bitfield="true" default="163">
Line fill alignment rules. For more info see [enum TextServer.JustificationFlag].
Line fill alignment rules. See [enum TextServer.JustificationFlag] for more information.
</member>
<member name="language" type="String" setter="set_language" getter="get_language" default="&quot;&quot;">
Language code used for line-breaking and text shaping algorithms, if left empty current locale is used instead.
Expand Down
9 changes: 9 additions & 0 deletions doc/classes/RichTextLabel.xml
Original file line number Diff line number Diff line change
Expand Up @@ -625,6 +625,12 @@
<member name="hint_underlined" type="bool" setter="set_hint_underline" getter="is_hint_underlined" default="true">
If [code]true[/code], the label underlines hint tags such as [code skip-lint][hint=description]{text}[/hint][/code].
</member>
<member name="horizontal_alignment" type="int" setter="set_horizontal_alignment" getter="get_horizontal_alignment" enum="HorizontalAlignment" default="0">
Controls the text's horizontal alignment. Supports left, center, right, and fill, or justify. Set it to one of the [enum HorizontalAlignment] constants.
</member>
<member name="justification_flags" type="int" setter="set_justification_flags" getter="get_justification_flags" enum="TextServer.JustificationFlag" is_bitfield="true" default="163">
Line fill alignment rules. See [enum TextServer.JustificationFlag] for more information.
</member>
<member name="language" type="String" setter="set_language" getter="get_language" default="&quot;&quot;">
Language code used for line-breaking and text shaping algorithms, if left empty current locale is used instead.
</member>
Expand Down Expand Up @@ -656,6 +662,9 @@
<member name="tab_size" type="int" setter="set_tab_size" getter="get_tab_size" default="4">
The number of spaces associated with a single tab length. Does not affect [code]\t[/code] in text tags, only indent tags.
</member>
<member name="tab_stops" type="PackedFloat32Array" setter="set_tab_stops" getter="get_tab_stops" default="PackedFloat32Array()">
Aligns text to the given tab-stops.
</member>
<member name="text" type="String" setter="set_text" getter="get_text" default="&quot;&quot;">
The label's text in BBCode format. Is not representative of manual modifications to the internal tag stack. Erases changes made by other methods when edited.
[b]Note:[/b] If [member bbcode_enabled] is [code]true[/code], it is unadvised to use the [code]+=[/code] operator with [member text] (e.g. [code]text += "some string"[/code]) as it replaces the whole text and can cause slowdowns. It will also erase all BBCode that was added to stack using [code]push_*[/code] methods. Use [method append_text] for adding text instead, unless you absolutely need to close a tag that was opened in an earlier method call.
Expand Down
2 changes: 1 addition & 1 deletion doc/classes/TextMesh.xml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
Controls the text's horizontal alignment. Supports left, center, right, and fill, or justify. Set it to one of the [enum HorizontalAlignment] constants.
</member>
<member name="justification_flags" type="int" setter="set_justification_flags" getter="get_justification_flags" enum="TextServer.JustificationFlag" is_bitfield="true" default="163">
Line fill alignment rules. For more info see [enum TextServer.JustificationFlag].
Line fill alignment rules. See [enum TextServer.JustificationFlag] for more information.
</member>
<member name="language" type="String" setter="set_language" getter="get_language" default="&quot;&quot;">
Language code used for text shaping algorithms, if left empty current locale is used instead.
Expand Down
2 changes: 1 addition & 1 deletion doc/classes/TextParagraph.xml
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,7 @@
Ellipsis character used for text clipping.
</member>
<member name="justification_flags" type="int" setter="set_justification_flags" getter="get_justification_flags" enum="TextServer.JustificationFlag" is_bitfield="true" default="163">
Line fill alignment rules. For more info see [enum TextServer.JustificationFlag].
Line fill alignment rules. See [enum TextServer.JustificationFlag] for more information.
</member>
<member name="max_lines_visible" type="int" setter="set_max_lines_visible" getter="get_max_lines_visible" default="-1">
Limits the lines of text shown.
Expand Down
4 changes: 3 additions & 1 deletion drivers/gles3/rasterizer_canvas_gles3.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2186,7 +2186,9 @@ void RasterizerCanvasGLES3::canvas_begin(RID p_to_render_target, bool p_to_backb
glBindFramebuffer(GL_FRAMEBUFFER, render_target->fbo);
glActiveTexture(GL_TEXTURE0 + config->max_texture_image_units - 4);
glBindTexture(GL_TEXTURE_2D, render_target->backbuffer);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAX_LEVEL, p_backbuffer_has_mipmaps ? render_target->mipmap_count - 1 : 0);
if (render_target->backbuffer != 0) {
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAX_LEVEL, p_backbuffer_has_mipmaps ? render_target->mipmap_count - 1 : 0);
}
}

if (render_target->is_transparent || p_to_backbuffer) {
Expand Down
8 changes: 5 additions & 3 deletions drivers/gles3/rasterizer_gles3.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -351,9 +351,6 @@ RasterizerGLES3::RasterizerGLES3() {
}
}

// Disable OpenGL linear to sRGB conversion, because Redot will always do this conversion itself.
glDisable(GL_FRAMEBUFFER_SRGB);

// OpenGL needs to be initialized before initializing the Rasterizers
config = memnew(GLES3::Config);
utilities = memnew(GLES3::Utilities);
Expand All @@ -370,6 +367,11 @@ RasterizerGLES3::RasterizerGLES3() {
fog = memnew(GLES3::Fog);
canvas = memnew(RasterizerCanvasGLES3());
scene = memnew(RasterizerSceneGLES3());

// Disable OpenGL linear to sRGB conversion, because Godot will always do this conversion itself.
if (config->srgb_framebuffer_supported) {
glDisable(GL_FRAMEBUFFER_SRGB);
}
}

RasterizerGLES3::~RasterizerGLES3() {
Expand Down
2 changes: 2 additions & 0 deletions drivers/gles3/storage/config.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ Config::Config() {
etc2_supported = false;
s3tc_supported = true;
rgtc_supported = true; //RGTC - core since OpenGL version 3.0
srgb_framebuffer_supported = true;
} else {
float_texture_supported = extensions.has("GL_EXT_color_buffer_float");
etc2_supported = true;
Expand All @@ -102,6 +103,7 @@ Config::Config() {
s3tc_supported = extensions.has("GL_EXT_texture_compression_dxt1") || extensions.has("GL_EXT_texture_compression_s3tc") || extensions.has("WEBGL_compressed_texture_s3tc");
#endif
rgtc_supported = extensions.has("GL_EXT_texture_compression_rgtc") || extensions.has("GL_ARB_texture_compression_rgtc") || extensions.has("EXT_texture_compression_rgtc");
srgb_framebuffer_supported = extensions.has("GL_EXT_sRGB_write_control");
}

glGetIntegerv(GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS, &max_vertex_texture_image_units);
Expand Down
1 change: 1 addition & 0 deletions drivers/gles3/storage/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ class Config {
bool astc_supported = false;
bool astc_hdr_supported = false;
bool astc_layered_supported = false;
bool srgb_framebuffer_supported = false;

bool force_vertex_shading = false;

Expand Down
2 changes: 1 addition & 1 deletion drivers/gles3/storage/light_storage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1387,7 +1387,7 @@ bool LightStorage::shadow_atlas_update_light(RID p_atlas, RID p_light_instance,
old_shadow = old_key & SHADOW_INDEX_MASK;

// Only re-allocate if a better option is available, and enough time has passed.
should_realloc = shadow_atlas->quadrants[old_quadrant].subdivision != (uint32_t)best_subdiv && (shadow_atlas->quadrants[old_quadrant].shadows[old_shadow].alloc_tick - tick > shadow_atlas_realloc_tolerance_msec);
should_realloc = shadow_atlas->quadrants[old_quadrant].subdivision != (uint32_t)best_subdiv && (tick - shadow_atlas->quadrants[old_quadrant].shadows[old_shadow].alloc_tick > shadow_atlas_realloc_tolerance_msec);
should_redraw = shadow_atlas->quadrants[old_quadrant].shadows[old_shadow].version != p_light_version;

if (!should_realloc) {
Expand Down
2 changes: 1 addition & 1 deletion editor/action_map_editor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -586,7 +586,7 @@ ActionMapEditor::ActionMapEditor() {

show_builtin_actions_checkbutton = memnew(CheckButton);
show_builtin_actions_checkbutton->set_text(TTR("Show Built-in Actions"));
show_builtin_actions_checkbutton->connect("toggled", callable_mp(this, &ActionMapEditor::set_show_builtin_actions));
show_builtin_actions_checkbutton->connect(SceneStringName(toggled), callable_mp(this, &ActionMapEditor::set_show_builtin_actions));
add_hbox->add_child(show_builtin_actions_checkbutton);

show_builtin_actions = EditorSettings::get_singleton()->get_project_metadata("project_settings", "show_builtin_actions", false);
Expand Down
14 changes: 5 additions & 9 deletions editor/animation_bezier_editor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1444,6 +1444,11 @@ void AnimationBezierTrackEdit::gui_input(const Ref<InputEvent> &p_event) {
i++;
}

AnimationPlayerEditor *ape = AnimationPlayerEditor::get_singleton();
if (ape) {
undo_redo->add_do_method(ape, "_animation_update_key_frame");
undo_redo->add_undo_method(ape, "_animation_update_key_frame");
}
undo_redo->commit_action();

} else if (select_single_attempt != IntPair(-1, -1)) {
Expand Down Expand Up @@ -1968,15 +1973,6 @@ void AnimationBezierTrackEdit::delete_selection() {
void AnimationBezierTrackEdit::_bezier_track_insert_key_at_anim(const Ref<Animation> &p_anim, int p_track, double p_time, real_t p_value, const Vector2 &p_in_handle, const Vector2 &p_out_handle, const Animation::HandleMode p_handle_mode) {
int idx = p_anim->bezier_track_insert_key(p_track, p_time, p_value, p_in_handle, p_out_handle);
p_anim->bezier_track_set_key_handle_mode(p_track, idx, p_handle_mode);

EditorUndoRedoManager *undo_redo = EditorUndoRedoManager::get_singleton();
undo_redo->create_action(TTR("Animation Bezier Curve Change Call"));
AnimationPlayerEditor *ape = AnimationPlayerEditor::get_singleton();
if (ape) {
undo_redo->add_do_method(ape, "_animation_update_key_frame");
undo_redo->add_undo_method(ape, "_animation_update_key_frame");
}
undo_redo->commit_action();
}

void AnimationBezierTrackEdit::_bind_methods() {
Expand Down
6 changes: 3 additions & 3 deletions editor/code_editor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -757,13 +757,13 @@ FindReplaceBar::FindReplaceBar() {
hbc_option_search->add_child(case_sensitive);
case_sensitive->set_text(TTR("Match Case"));
case_sensitive->set_focus_mode(FOCUS_NONE);
case_sensitive->connect("toggled", callable_mp(this, &FindReplaceBar::_search_options_changed));
case_sensitive->connect(SceneStringName(toggled), callable_mp(this, &FindReplaceBar::_search_options_changed));

whole_words = memnew(CheckBox);
hbc_option_search->add_child(whole_words);
whole_words->set_text(TTR("Whole Words"));
whole_words->set_focus_mode(FOCUS_NONE);
whole_words->connect("toggled", callable_mp(this, &FindReplaceBar::_search_options_changed));
whole_words->connect(SceneStringName(toggled), callable_mp(this, &FindReplaceBar::_search_options_changed));

// Replace toolbar
replace_text = memnew(LineEdit);
Expand All @@ -788,7 +788,7 @@ FindReplaceBar::FindReplaceBar() {
hbc_option_replace->add_child(selection_only);
selection_only->set_text(TTR("Selection Only"));
selection_only->set_focus_mode(FOCUS_NONE);
selection_only->connect("toggled", callable_mp(this, &FindReplaceBar::_search_options_changed));
selection_only->connect(SceneStringName(toggled), callable_mp(this, &FindReplaceBar::_search_options_changed));

hide_button = memnew(TextureButton);
add_child(hide_button);
Expand Down
4 changes: 2 additions & 2 deletions editor/editor_asset_installer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -690,7 +690,7 @@ EditorAssetInstaller::EditorAssetInstaller() {
show_source_files_button->set_toggle_mode(true);
show_source_files_button->set_tooltip_text(TTR("Open the list of the asset contents and select which files to install."));
remapping_tools->add_child(show_source_files_button);
show_source_files_button->connect("toggled", callable_mp(this, &EditorAssetInstaller::_toggle_source_tree).bind(false));
show_source_files_button->connect(SceneStringName(toggled), callable_mp(this, &EditorAssetInstaller::_toggle_source_tree).bind(false));

Button *target_dir_button = memnew(Button);
target_dir_button->set_text(TTR("Change Install Folder"));
Expand All @@ -703,7 +703,7 @@ EditorAssetInstaller::EditorAssetInstaller() {
skip_toplevel_check = memnew(CheckBox);
skip_toplevel_check->set_text(TTR("Ignore asset root"));
skip_toplevel_check->set_tooltip_text(TTR("Ignore the root directory when extracting files."));
skip_toplevel_check->connect("toggled", callable_mp(this, &EditorAssetInstaller::_set_skip_toplevel));
skip_toplevel_check->connect(SceneStringName(toggled), callable_mp(this, &EditorAssetInstaller::_set_skip_toplevel));
remapping_tools->add_child(skip_toplevel_check);

remapping_tools->add_spacer();
Expand Down
24 changes: 13 additions & 11 deletions editor/editor_inspector.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2768,8 +2768,9 @@ void EditorInspector::update_tree() {
// TODO: Can be useful to store more context for the focusable, such as the caret position in LineEdit.
StringName current_selected = property_selected;
int current_focusable = -1;
// Temporarily disable focus following to avoid jumping while the inspector is updating.
set_follow_focus(false);

// Temporarily disable focus following on the root inspector to avoid jumping while the inspector is updating.
get_root_inspector()->set_follow_focus(false);

if (property_focusable != -1) {
// Check that focusable is actually focusable.
Expand Down Expand Up @@ -2797,6 +2798,7 @@ void EditorInspector::update_tree() {
_clear(!object);

if (!object) {
get_root_inspector()->set_follow_focus(true);
return;
}

Expand Down Expand Up @@ -3534,7 +3536,8 @@ void EditorInspector::update_tree() {
// Updating inspector might invalidate some editing owners.
EditorNode::get_singleton()->hide_unused_editors();
}
set_follow_focus(true);

get_root_inspector()->set_follow_focus(true);
}

void EditorInspector::update_property(const String &p_prop) {
Expand Down Expand Up @@ -3779,11 +3782,10 @@ void EditorInspector::set_use_wide_editors(bool p_enable) {
wide_editors = p_enable;
}

void EditorInspector::set_sub_inspector(bool p_enable) {
sub_inspector = p_enable;
if (!is_inside_tree()) {
return;
}
void EditorInspector::set_root_inspector(EditorInspector *p_root_inspector) {
root_inspector = p_root_inspector;
// Only the root inspector should follow focus.
set_follow_focus(false);
}

void EditorInspector::set_use_deletable_properties(bool p_enabled) {
Expand Down Expand Up @@ -4101,13 +4103,13 @@ void EditorInspector::_notification(int p_what) {
EditorFeatureProfileManager::get_singleton()->connect("current_feature_profile_changed", callable_mp(this, &EditorInspector::_feature_profile_changed));
set_process(is_visible_in_tree());
add_theme_style_override(SceneStringName(panel), get_theme_stylebox(SceneStringName(panel), SNAME("Tree")));
if (!sub_inspector) {
if (!is_sub_inspector()) {
get_tree()->connect("node_removed", callable_mp(this, &EditorInspector::_node_removed));
}
} break;

case NOTIFICATION_PREDELETE: {
if (!sub_inspector && is_inside_tree()) {
if (!is_sub_inspector() && is_inside_tree()) {
get_tree()->disconnect("node_removed", callable_mp(this, &EditorInspector::_node_removed));
}
edit(nullptr);
Expand Down Expand Up @@ -4166,7 +4168,7 @@ void EditorInspector::_notification(int p_what) {

case EditorSettings::NOTIFICATION_EDITOR_SETTINGS_CHANGED: {
bool needs_update = false;
if (EditorThemeManager::is_generated_theme_outdated() && !sub_inspector) {
if (!is_sub_inspector() && EditorThemeManager::is_generated_theme_outdated()) {
add_theme_style_override(SceneStringName(panel), get_theme_stylebox(SceneStringName(panel), SNAME("Tree")));
}

Expand Down
Loading
Loading