Skip to content

Commit

Permalink
Merge pull request #80432 from rsubtil/fix_linux_joypad_on_thread
Browse files Browse the repository at this point in the history
Ensure `joy_connection_changed` is emitted on the main thread
  • Loading branch information
akien-mga committed Aug 9, 2023
2 parents 1b132b7 + 1bb73b0 commit 5cfa9a0
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion core/input/input.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 5cfa9a0

Please sign in to comment.