MCPcopy Create free account
hub / github.com/Redot-Engine/redot-engine / embed_process

Method embed_process

editor/run/embedded_process.cpp:196–220  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

194}
195
196void EmbeddedProcess::embed_process(OS::ProcessID p_pid) {
197 if (!window) {
198 return;
199 }
200
201 ERR_FAIL_COND_MSG(!DisplayServer::get_singleton()->has_feature(DisplayServer::FEATURE_WINDOW_EMBEDDING), "Embedded process not supported by this display server.");
202
203 if (current_process_id != 0) {
204 // Stop embedding the last process.
205 OS::get_singleton()->kill(current_process_id);
206 }
207
208 reset();
209
210 current_process_id = p_pid;
211 start_embedding_time = OS::get_singleton()->get_ticks_msec();
212 embedding_grab_focus = has_focus();
213 timer_update_embedded_process->start();
214 set_process(true);
215 set_notify_transform(true);
216
217 // Attempt to embed the process, but if it has just started and the window is not ready yet,
218 // we will retry in this case.
219 _try_embed_process();
220}
221
222void EmbeddedProcess::reset() {
223 if (current_process_id != 0 && embedding_completed) {

Callers 3

_try_embed_processMethod · 0.45
_play_pressedMethod · 0.45

Calls 5

resetFunction · 0.85
has_featureMethod · 0.45
killMethod · 0.45
get_ticks_msecMethod · 0.45
startMethod · 0.45

Tested by

no test coverage detected