Skip to content

fix: remove hotplug hitch with unified controller event flow#53

Open
MRZ07 wants to merge 1 commit into
libgdx:masterfrom
MRZ07:deep-unification-controller-events
Open

fix: remove hotplug hitch with unified controller event flow#53
MRZ07 wants to merge 1 commit into
libgdx:masterfrom
MRZ07:deep-unification-controller-events

Conversation

@MRZ07
Copy link
Copy Markdown

@MRZ07 MRZ07 commented May 29, 2026

What changed

  • added shared core ControllerEvent + ControllerEventQueue and core queue tests
  • migrated Android, GWT, and iOS manager lifecycle/input queueing to the shared event queue
  • removed duplicated backend event DTOs (AndroidControllerEvent, GwtControllerEvent)
  • moved desktop Jamepad polling off render thread into a dedicated monitor thread while keeping dispatch on render thread
  • added lazy haptics initialization on iOS to keep connection path lightweight

Why

Controller hotplug could stall game frames, especially on desktop where native polling ran on the render thread. This change centralizes event flow and minimizes work done in connection paths across all backends.

Verification

  • JAVA_HOME="/opt/homebrew/opt/openjdk@17/libexec/openjdk.jdk/Contents/Home" ./gradlew :gdx-controllers-core:test --tests '*ControllerEventQueueTest'
  • JAVA_HOME="/opt/homebrew/opt/openjdk@17/libexec/openjdk.jdk/Contents/Home" ./gradlew :test:desktop:build :test:lwjgl3:build
  • JAVA_HOME="/opt/homebrew/opt/openjdk@17/libexec/openjdk.jdk/Contents/Home" ./gradlew :test:ios:build
  • JAVA_HOME="/opt/homebrew/opt/openjdk@17/libexec/openjdk.jdk/Contents/Home" ./gradlew :test:html:build
  • JAVA_HOME="/opt/homebrew/opt/openjdk@17/libexec/openjdk.jdk/Contents/Home" ./gradlew :gdx-controllers-core:test

Known environment limitation

  • :test:android:buildDebug could not be run locally because Android SDK is not configured in this environment (ANDROID_HOME / local.properties missing).

@MRZ07 MRZ07 force-pushed the deep-unification-controller-events branch from 1c8b137 to 7ab23c4 Compare May 29, 2026 22:02
@MRZ07 MRZ07 changed the title refactor: unify controller event queue and remove hotplug hitch fix: remove hotplug hitch with unified controller event flow May 29, 2026
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.

1 participant