From fc79b3c11593f268273255032bc9f0c48067af61 Mon Sep 17 00:00:00 2001 From: LanzaSchneider Date: Sat, 29 Nov 2025 09:12:33 +0800 Subject: [PATCH] Fix focus grab warning on macOS when running game in embedded mode. --- editor/run/game_view_plugin.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/editor/run/game_view_plugin.cpp b/editor/run/game_view_plugin.cpp index 5361dbdd1d3..bcfba467479 100644 --- a/editor/run/game_view_plugin.cpp +++ b/editor/run/game_view_plugin.cpp @@ -357,7 +357,9 @@ void GameView::_instance_starting(int p_idx, List &r_arguments) { _show_update_window_wrapper(); - embedded_process->grab_focus(); + if (embedded_process->get_focus_mode_with_override() != FOCUS_NONE) { + embedded_process->grab_focus(); + } } _update_arguments_for_instance(p_idx, r_arguments); @@ -444,7 +446,10 @@ void GameView::_play_pressed() { EditorNode::get_singleton()->get_editor_main_screen()->select(EditorMainScreen::EDITOR_GAME); // Reset the normal size of the bottom panel when fully expanded. EditorNode::get_singleton()->get_bottom_panel()->set_expanded(false); - embedded_process->grab_focus(); + + if (embedded_process->get_focus_mode_with_override() != FOCUS_NONE) { + embedded_process->grab_focus(); + } } embedded_process->embed_process(current_process_id); _update_ui();