Skip to content

Commit 8e32d4f

Browse files
Fix focus grab warning on macOS when running game in embedded mode.
1 parent 7ed0b61 commit 8e32d4f

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

editor/run/game_view_plugin.cpp

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -357,7 +357,9 @@ void GameView::_instance_starting(int p_idx, List<String> &r_arguments) {
357357

358358
_show_update_window_wrapper();
359359

360-
embedded_process->grab_focus();
360+
if (embedded_process->get_focus_mode_with_override() != FOCUS_NONE) {
361+
embedded_process->grab_focus();
362+
}
361363
}
362364

363365
_update_arguments_for_instance(p_idx, r_arguments);
@@ -444,7 +446,10 @@ void GameView::_play_pressed() {
444446
EditorNode::get_singleton()->get_editor_main_screen()->select(EditorMainScreen::EDITOR_GAME);
445447
// Reset the normal size of the bottom panel when fully expanded.
446448
EditorNode::get_singleton()->get_bottom_panel()->set_expanded(false);
447-
embedded_process->grab_focus();
449+
450+
if (embedded_process->get_focus_mode_with_override() != FOCUS_NONE) {
451+
embedded_process->grab_focus();
452+
}
448453
}
449454
embedded_process->embed_process(current_process_id);
450455
_update_ui();

0 commit comments

Comments
 (0)