Files
DroidDeck/tools
TapuukandTapuuk fdf3d98c36 fix(input): stop controller rumble when the game that started it is gone (#2614)
* fix(input): stop controller rumble when the game that started it is gone

A crashed game never sends the stop for a held rumble, so the keepalive re-armed it every 1.5 s until the session ended. A held effect now stops on the next keepalive once the process that sent it or the Steam game it started in has exited. The fake controller also stops its rumble when it's closed or the playing effect is erased, like the kernel does.

* test: read the test's own pid from /proc/self

* fix(input): track who plays rumble on each slot, check the game when a hold starts

The process that plays an effect now owns it, and only the handle currently playing on a slot sends the stop when it closes or erases its effect. A held effect records whether a game is running when it starts, and keeps checking that its sender still exists even when its start time couldn't be read.

* fix(input): only cache a running game, not its absence

A new hold claimed right after a no-game result reused it, so a game that started within the cache window was never watched.

* fix(input): treat a vanished sender of our own user as gone

Guest processes run as the app's user, so the app can always see them in /proc. If one is missing at the first lookup it already exited; only senders of another user (root-spawned guests) are left unchecked.

* fix(input): a stop only ends rumble the same process started

The fake controller's playing-handle tracking is per process, so another process closing or erasing its older effect still sent a slot-wide stop. The app now ignores a stop whose sender isn't the one behind the slot's current effect; stops from an unknown sender work as before.

---------

Co-authored-by: Tapuuk <177422350+Tapuuk@users.noreply.github.com>
2026-11-14 23:56:08 -05:00
..