Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix lag when resizing Floating Game Window #102618

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 8 additions & 5 deletions editor/plugins/embedded_process.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,12 @@ void EmbeddedProcess::_notification(int p_what) {
case NOTIFICATION_ENTER_TREE: {
window = get_window();
} break;
case NOTIFICATION_PROCESS: {
if (updated_embedded_process_queued) {
updated_embedded_process_queued = false;
_update_embedded_process();
}
} break;
case NOTIFICATION_DRAW: {
_draw();
} break;
Expand Down Expand Up @@ -179,6 +185,7 @@ void EmbeddedProcess::embed_process(OS::ProcessID p_pid) {
start_embedding_time = OS::get_singleton()->get_ticks_msec();
embedding_grab_focus = has_focus();
timer_update_embedded_process->start();
set_process(true);
set_notify_transform(true);

// Attempt to embed the process, but if it has just started and the window is not ready yet,
Expand All @@ -196,6 +203,7 @@ void EmbeddedProcess::reset() {
embedding_grab_focus = false;
timer_embedding->stop();
timer_update_embedded_process->stop();
set_process(false);
set_notify_transform(false);
queue_redraw();
}
Expand Down Expand Up @@ -251,11 +259,6 @@ void EmbeddedProcess::_timer_update_embedded_process_timeout() {
queue_update_embedded_process();
}
}

if (updated_embedded_process_queued) {
updated_embedded_process_queued = false;
_update_embedded_process();
}
}

void EmbeddedProcess::_update_embedded_process() {
Expand Down