Skip to content

Fix controller reconnect detection#629

Draft
NicholasBellDev wants to merge 1 commit into
MrCrayfish:multiloader/26.1.2from
NicholasBellDev:fix-controller-reconnect
Draft

Fix controller reconnect detection#629
NicholasBellDev wants to merge 1 commit into
MrCrayfish:multiloader/26.1.2from
NicholasBellDev:fix-controller-reconnect

Conversation

@NicholasBellDev

Copy link
Copy Markdown

Fixes #623.

Summary

This updates controller reconnect handling so a controller sleep/wake cycle is detected even when the raw controller count stays the same.

The controller manager now compares the full controller map and validates whether the currently selected controller is still open before deciding there is nothing to update. SDL and GLFW controllers also tolerate repeated close/is-open checks without dereferencing a null native handle.

For SDL, joystick and game controller state is refreshed before opening, attachment checks, and device enumeration. This helps SDL observe Bluetooth controller sleep/wake transitions before Controllable decides whether to reconnect or auto-select a controller.

Validation

  • git diff --check
  • Manual test with a DualSense controller on Windows/Bluetooth in a Forge 1.20.1 modpack using the equivalent patched behavior: after the controller slept and woke, Controllable detected it again without restarting Minecraft.

Local Gradle compilation could not complete in this checkout because required MrCrayfish artifacts (framework-*, controllable-sdl) were not resolvable from the configured public repositories, and the loader-excluded compile path hit local Java toolchain provisioning for Java 25.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

controller breakes mid game

2 participants