diff options
author | Ricardo Subtil <ricasubtil@gmail.com> | 2023-08-08 21:51:33 +0100 |
---|---|---|
committer | rsubtil <ricasubtil@gmail.com> | 2023-08-09 15:32:06 +0100 |
commit | 1bb73b0689a9cc2731eee63374f07e08b35b6e6a (patch) | |
tree | 0d338af3bdc8d38e8b20c7da8dbd44ae96cede7d | |
parent | eca6f0eb545166708c56633152974f40f51de2be (diff) | |
download | redot-engine-1bb73b0689a9cc2731eee63374f07e08b35b6e6a.tar.gz |
Ensure `joy_connection_changed` is emitted on the main thread
-rw-r--r-- | core/input/input.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/core/input/input.cpp b/core/input/input.cpp index 4a32abfafa..39f1acf623 100644 --- a/core/input/input.cpp +++ b/core/input/input.cpp @@ -475,7 +475,8 @@ void Input::joy_connection_changed(int p_idx, bool p_connected, String p_name, S } joy_names[p_idx] = js; - emit_signal(SNAME("joy_connection_changed"), p_idx, p_connected); + // Ensure this signal is emitted on the main thread, as some platforms (e.g. Linux) call this from a different thread. + call_deferred("emit_signal", SNAME("joy_connection_changed"), p_idx, p_connected); } Vector3 Input::get_gravity() const { |