Commit 2f045e3
committed
fix: review fixes + dropped upstream improvements on the vibration path
Bot review (PR utkarshdalal#1214):
- ContainerUtils.toContainerData / applyToContainer: normalize vibrationMode
via PrefManager.normalizeVibrationModeInput and clamp vibrationIntensity
to 0..100 at the read/write boundary. Stops a stale 'both' (or any other
invalid value) carried over from the prior schema from propagating into
ContainerData and back to disk.
- ContainerData.Saver/restorer: same defence on the Compose Saver round-trip
via a private VALID_RESTORED_VIBRATION_MODES whitelist plus an
Int.coerceIn(0, 100) on intensity. Rebuilt invalid mode strings fall back
to 'controller'.
- WinHandler.startRumblePoller: re-check 'running' after acquiring
rumbleNotifyLock so a stop() that runs between the outer while(running)
check and the synchronized block is observed before the poller goes
into wait(0). Without this, stop()'s notifyAll() is the only chance to
wake the poller and a tight race could miss it.
- WinHandler.rumbleViaVibratorManager: Arrays.sort(ids) instead of a
two-element manual swap. Generalises the heavy/light motor selection to
3+ vibrator controllers (DualSense edition variants); 2-vibrator cases
produce the same result as before.
Broader review (dropped from upstream PR utkarshdalal#1261 when copying pre-cleanup's
WinHandler wholesale):
- WinHandler GET_GAMEPAD adoption: when no current controller is set,
consult ControllerManager.getAssignedDeviceForSlot(0) instead of
ExternalController.getController(0). The latter queries InputDevice ID
0 — an arbitrary number that rarely corresponds to the user's slot-0
assignment.
- WinHandler.start(): call initializeAssignedControllers() so saved slot
assignments are pre-registered before the first GET_GAMEPAD packet
arrives. Pre-cleanup defined the method but never called it (dead code);
upstream's PR called it from start(), and games that probe controllers
at startup were depending on that pre-registration.1 parent 315fe1f commit 2f045e3
3 files changed
Lines changed: 42 additions & 10 deletions
File tree
- app/src/main/java
- app/gamenative/utils
- com/winlator
- container
- winhandler
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
325 | 325 | | |
326 | 326 | | |
327 | 327 | | |
328 | | - | |
329 | | - | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
330 | 333 | | |
331 | 334 | | |
332 | 335 | | |
| |||
495 | 498 | | |
496 | 499 | | |
497 | 500 | | |
498 | | - | |
499 | | - | |
| 501 | + | |
| 502 | + | |
| 503 | + | |
| 504 | + | |
| 505 | + | |
| 506 | + | |
| 507 | + | |
| 508 | + | |
500 | 509 | | |
501 | 510 | | |
502 | 511 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
104 | 104 | | |
105 | 105 | | |
106 | 106 | | |
| 107 | + | |
| 108 | + | |
107 | 109 | | |
108 | 110 | | |
109 | 111 | | |
| |||
188 | 190 | | |
189 | 191 | | |
190 | 192 | | |
191 | | - | |
192 | | - | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
193 | 198 | | |
194 | 199 | | |
195 | 200 | | |
| |||
Lines changed: 22 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
511 | 511 | | |
512 | 512 | | |
513 | 513 | | |
514 | | - | |
| 514 | + | |
| 515 | + | |
| 516 | + | |
| 517 | + | |
| 518 | + | |
| 519 | + | |
| 520 | + | |
| 521 | + | |
515 | 522 | | |
516 | 523 | | |
517 | 524 | | |
| |||
672 | 679 | | |
673 | 680 | | |
674 | 681 | | |
| 682 | + | |
| 683 | + | |
| 684 | + | |
| 685 | + | |
| 686 | + | |
675 | 687 | | |
676 | 688 | | |
677 | 689 | | |
| |||
786 | 798 | | |
787 | 799 | | |
788 | 800 | | |
| 801 | + | |
| 802 | + | |
| 803 | + | |
| 804 | + | |
| 805 | + | |
789 | 806 | | |
790 | 807 | | |
791 | 808 | | |
| |||
847 | 864 | | |
848 | 865 | | |
849 | 866 | | |
850 | | - | |
851 | | - | |
| 867 | + | |
| 868 | + | |
| 869 | + | |
| 870 | + | |
852 | 871 | | |
853 | 872 | | |
854 | 873 | | |
855 | 874 | | |
856 | | - | |
857 | 875 | | |
858 | 876 | | |
859 | 877 | | |
| |||
0 commit comments