Skip to content

Commit c7ae694

Browse files
committed
Merge pull request #113300 from LanzaSchneider/fix-focus-grab-warning-macos
MacOS: Fix focus grab warning on macOS when running game in embedded mode.
2 parents 4dad75f + fc79b3c commit c7ae694

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
@@ -358,7 +358,9 @@ void GameView::_instance_starting(int p_idx, List<String> &r_arguments) {
358358

359359
_show_update_window_wrapper();
360360

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

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

0 commit comments

Comments
 (0)