Skip to content

Commit

Permalink
Ensure joy_connection_changed is emitted on the main thread
Browse files Browse the repository at this point in the history
(cherry picked from commit 1bb73b0)
  • Loading branch information
rsubtil authored and akien-mga committed Aug 28, 2023
1 parent 5c80d42 commit d0d2680
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions main/input_default.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -298,8 +298,9 @@ void InputDefault::joy_connection_changed(int p_idx, bool p_connected, String p_
};
joy_names[p_idx] = js;

emit_signal("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", "joy_connection_changed", p_idx, p_connected);
}

Vector3 InputDefault::get_gravity() const {
_THREAD_SAFE_METHOD_
Expand Down

0 comments on commit d0d2680

Please sign in to comment.