Fix debugging embedded game does not refocus on continue
This commit is contained in:
@ -296,6 +296,7 @@ void EmbeddedProcess::_check_focused_process_id() {
|
|||||||
focused_process_id = process_id;
|
focused_process_id = process_id;
|
||||||
if (focused_process_id == current_process_id) {
|
if (focused_process_id == current_process_id) {
|
||||||
// The embedded process got the focus.
|
// The embedded process got the focus.
|
||||||
|
emit_signal(SNAME("embedded_process_focused"));
|
||||||
if (has_focus()) {
|
if (has_focus()) {
|
||||||
// Redraw to updated the focus style.
|
// Redraw to updated the focus style.
|
||||||
queue_redraw();
|
queue_redraw();
|
||||||
@ -312,6 +313,7 @@ void EmbeddedProcess::_bind_methods() {
|
|||||||
ADD_SIGNAL(MethodInfo("embedding_completed"));
|
ADD_SIGNAL(MethodInfo("embedding_completed"));
|
||||||
ADD_SIGNAL(MethodInfo("embedding_failed"));
|
ADD_SIGNAL(MethodInfo("embedding_failed"));
|
||||||
ADD_SIGNAL(MethodInfo("embedded_process_updated"));
|
ADD_SIGNAL(MethodInfo("embedded_process_updated"));
|
||||||
|
ADD_SIGNAL(MethodInfo("embedded_process_focused"));
|
||||||
}
|
}
|
||||||
|
|
||||||
EmbeddedProcess::EmbeddedProcess() {
|
EmbeddedProcess::EmbeddedProcess() {
|
||||||
|
|||||||
@ -260,6 +260,12 @@ void GameView::_embedded_process_updated() {
|
|||||||
game_size_label->set_text(vformat("%dx%d", game_rect.size.x, game_rect.size.y));
|
game_size_label->set_text(vformat("%dx%d", game_rect.size.x, game_rect.size.y));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void GameView::_embedded_process_focused() {
|
||||||
|
if (embed_on_play && !window_wrapper->get_window_enabled()) {
|
||||||
|
EditorNode::get_singleton()->get_editor_main_screen()->select(EditorMainScreen::EDITOR_GAME);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void GameView::_project_settings_changed() {
|
void GameView::_project_settings_changed() {
|
||||||
// Update the window size and aspect ratio.
|
// Update the window size and aspect ratio.
|
||||||
_update_embed_window_size();
|
_update_embed_window_size();
|
||||||
@ -730,6 +736,7 @@ GameView::GameView(Ref<GameViewDebugger> p_debugger, WindowWrapper *p_wrapper) {
|
|||||||
embedded_process->connect("embedding_failed", callable_mp(this, &GameView::_embedding_failed));
|
embedded_process->connect("embedding_failed", callable_mp(this, &GameView::_embedding_failed));
|
||||||
embedded_process->connect("embedding_completed", callable_mp(this, &GameView::_embedding_completed));
|
embedded_process->connect("embedding_completed", callable_mp(this, &GameView::_embedding_completed));
|
||||||
embedded_process->connect("embedded_process_updated", callable_mp(this, &GameView::_embedded_process_updated));
|
embedded_process->connect("embedded_process_updated", callable_mp(this, &GameView::_embedded_process_updated));
|
||||||
|
embedded_process->connect("embedded_process_focused", callable_mp(this, &GameView::_embedded_process_focused));
|
||||||
embedded_process->set_custom_minimum_size(Size2i(100, 100));
|
embedded_process->set_custom_minimum_size(Size2i(100, 100));
|
||||||
|
|
||||||
state_label = memnew(Label());
|
state_label = memnew(Label());
|
||||||
|
|||||||
@ -143,6 +143,7 @@ class GameView : public VBoxContainer {
|
|||||||
void _embedding_completed();
|
void _embedding_completed();
|
||||||
void _embedding_failed();
|
void _embedding_failed();
|
||||||
void _embedded_process_updated();
|
void _embedded_process_updated();
|
||||||
|
void _embedded_process_focused();
|
||||||
void _project_settings_changed();
|
void _project_settings_changed();
|
||||||
|
|
||||||
void _update_ui();
|
void _update_ui();
|
||||||
|
|||||||
Reference in New Issue
Block a user