summaryrefslogtreecommitdiffstats
path: root/core/script_debugger_remote.cpp
diff options
context:
space:
mode:
authorPedro J. Estébanez <pedrojrulez@gmail.com>2018-05-28 21:49:48 +0200
committerPedro J. Estébanez <pedrojrulez@gmail.com>2018-05-28 21:49:48 +0200
commit2fcbf9dd8105940cefecb9c1d666bf3002869996 (patch)
treeb18fbe505074eb1fca7924bc0f8a7e31c9f3bbca /core/script_debugger_remote.cpp
parent4a98b1575bd0b890e834c54a2216f839e9540543 (diff)
downloadredot-engine-2fcbf9dd8105940cefecb9c1d666bf3002869996.tar.gz
Fix debugger focus stealing
At least on Windows, the authorization must be given every time, not only at startup.
Diffstat (limited to 'core/script_debugger_remote.cpp')
-rw-r--r--core/script_debugger_remote.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/core/script_debugger_remote.cpp b/core/script_debugger_remote.cpp
index 75bcedbbc8..4922a03f92 100644
--- a/core/script_debugger_remote.cpp
+++ b/core/script_debugger_remote.cpp
@@ -169,6 +169,10 @@ void ScriptDebuggerRemote::debug(ScriptLanguage *p_script, bool p_can_continue)
ERR_FAIL();
}
+ if (allow_focus_steal_pid) {
+ OS::get_singleton()->enable_for_stealing_focus(allow_focus_steal_pid);
+ }
+
packet_peer_stream->put_var("debug_enter");
packet_peer_stream->put_var(2);
packet_peer_stream->put_var(p_can_continue);
@@ -1044,6 +1048,10 @@ void ScriptDebuggerRemote::profiling_set_frame_times(float p_frame_time, float p
physics_frame_time = p_physics_frame_time;
}
+void ScriptDebuggerRemote::set_allow_focus_steal_pid(OS::ProcessID p_pid) {
+ allow_focus_steal_pid = p_pid;
+}
+
ScriptDebuggerRemote::ResourceUsageFunc ScriptDebuggerRemote::resource_usage_func = NULL;
ScriptDebuggerRemote::ScriptDebuggerRemote() :
@@ -1065,6 +1073,7 @@ ScriptDebuggerRemote::ScriptDebuggerRemote() :
n_errors_dropped(0),
last_msec(0),
msec_count(0),
+ allow_focus_steal_pid(0),
locking(false),
poll_every(0),
request_scene_tree(NULL),