From 1cc459d86fccbcbf8d9f7ce820b9a13ccfa52ff9 Mon Sep 17 00:00:00 2001 From: Mounir Tohami <53877170+WhalesState@users.noreply.github.com> Date: Fri, 25 Jul 2025 01:05:15 +0300 Subject: [PATCH] Fix Editor wayland first scan task error. Co-authored-by: Tomasz Chabora --- editor/editor_node.cpp | 2 +- editor/gui/progress_dialog.cpp | 8 ++++++++ editor/gui/progress_dialog.h | 1 + 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/editor/editor_node.cpp b/editor/editor_node.cpp index 975b607a434..28d02033624 100644 --- a/editor/editor_node.cpp +++ b/editor/editor_node.cpp @@ -851,7 +851,7 @@ void EditorNode::_notification(int p_what) { command_palette->register_shortcuts_as_command(); - callable_mp(this, &EditorNode::_begin_first_scan).call_deferred(); + _begin_first_scan(); last_dark_mode_state = DisplayServer::get_singleton()->is_dark_mode(); last_system_accent_color = DisplayServer::get_singleton()->get_accent_color(); diff --git a/editor/gui/progress_dialog.cpp b/editor/gui/progress_dialog.cpp index 2f551a4e57b..5353faf9929 100644 --- a/editor/gui/progress_dialog.cpp +++ b/editor/gui/progress_dialog.cpp @@ -166,6 +166,14 @@ void ProgressDialog::_popup() { center_panel->set_custom_minimum_size(ms); + if (is_ready()) { + _reparent_and_show(); + } else { + callable_mp(this, &ProgressDialog::_reparent_and_show).call_deferred(); + } +} + +void ProgressDialog::_reparent_and_show() { Window *current_window = SceneTree::get_singleton()->get_root()->get_last_exclusive_window(); ERR_FAIL_NULL(current_window); reparent(current_window); diff --git a/editor/gui/progress_dialog.h b/editor/gui/progress_dialog.h index 6a1747ffecf..17deeac79c8 100644 --- a/editor/gui/progress_dialog.h +++ b/editor/gui/progress_dialog.h @@ -89,6 +89,7 @@ class ProgressDialog : public CenterContainer { void _cancel_pressed(); void _update_ui(); + void _reparent_and_show(); bool canceled = false; protected: