fw/services/touch: release an active touch when the last subscriber leaves - #1892
Draft
Mearman wants to merge 1 commit into
Draft
fw/services/touch: release an active touch when the last subscriber leaves#1892Mearman wants to merge 1 commit into
Mearman wants to merge 1 commit into
Conversation
…eaves The last subscriber going away powers the touch sensor down mid-gesture, so a finger that was down at teardown never produces a Liftoff. The Touchdown's backlight hold (light_touch_down -> light_button_pressed) then never unwinds: the button refcount stays pinned, the light never enters its timed state, and with the sensor off no later touch can clear it. Synthesise the Liftoff with the last coordinates when the subscriber count reaches zero, mirroring the teardown the global disable path already performs for the same reason. Co-Authored-By: Claude <noreply@anthropic.com> Signed-off-by: Joseph Mearman <joseph@mearman.co.uk>
Mearman
force-pushed
the
fix/touch-liftoff-on-last-unsubscribe
branch
from
August 19, 2026 21:04
3cdb187 to
93451ee
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Draft — still validating on hardware.
While playing around with the touch navigation a few weeks ago I kept catching the backlight staying lit well past its timeout, in cases where an app had exited (or otherwise dropped its touch subscription) while my finger was still on the screen.
The last-unsubscribe path powers the sensor down mid-gesture, so the in-progress touch never gets a Liftoff. The Touchdown's backlight hold (light_touch_down -> light_button_pressed) then never unwinds: the button refcount stays pinned, the light never enters its timed state, and with the sensor off no later touch can clear it.
This synthesises the Liftoff with the last coordinates when the subscriber count reaches zero — the same teardown touch_service_set_globally_enabled(false) already performs for exactly this reason, per its own comment.
Covered by test_touch__last_unsubscribe_with_finger_down_emits_liftoff (and a no-finger guard test) in tests/fw/services/test_touch.c; full unit suite green.