Skip to content

input: a click with no control under it is OK after D-pad navigation - #803

Merged
GLinnik21 merged 2 commits into
plxnative:mainfrom
dimitrije83:ok-click-drift
Oct 18, 2026
Merged

GLinnik21 merged 2 commits into
plxnative:mainfrom
dimitrije83:ok-click-drift

Conversation

@dimitrije83

Copy link
Copy Markdown
Contributor

Follow-up to #781, which does not work on the device. I'm sorry: its description claimed a TV check that I had not actually done.

What was wrong with #781

#781 turns a click back into OK only while the pointer is hidden. Pressing OK jiggles a Magic Remote, and any motion shows the pointer again, so on the set the condition was never true. Arrow to the … disc, press OK, and the film paused.

Keying it on pointer travel alone isn't enough either. Travel is summed since the last arrow press, so a hand that is just holding the remote drifts past any gate. I measured 159, 262, 384 and 600 px between arrowing to a control and pressing OK. Over full-screen video the player never leaves D-pad mode, so the click went to the picture.

The rule now

In D-pad mode on a transparent-cursor set, a click is OK when either:

  • travel since the last arrow press is under DPAD_MOTION_GATE (the existing 120 px, now named), or
  • the click lands on no control (hit.top_at is empty).

A click on a control after real travel still goes to that control, so pointing at a button and clicking it works as before.

Tested

On an LG OLED55B7V-Z, webOS 3.9.3, with temporary log lines that are not in this PR:

  • With the remote moving, I arrowed to Subtitles, the Info tab and …, then pressed OK. Each click arrived after 159–384 px of drift, was turned into OK, and opened the focused control.
  • Pointing at the … disc and clicking opened it.
  • A pointer click on bare video paused, as before.

make check passes (16,353 tests, 0 failed), and so does cargo +nightly check --lib --no-default-features. Only webOS 3.9.3 is tested. Sets with SDL_webOSCursorVisibility aren't affected, because the rule needs the transparent cursor.

… however far the pointer drifted

plxnative#781 keyed the click-to-OK on the pointer being hidden. Pressing OK jiggles
a Magic Remote and any motion shows the pointer again, so on the device it
never fired: arrow to the ... disc, press OK, and the film paused.

Keying it on travel alone is not enough either. Travel is summed since the
last arrow press, and a hand holding the remote drifts past any gate: 159,
262, 384 and 600 px measured on an OLED55B7V-Z (webOS 3.9.3) between
arrowing to a control and pressing OK. Over full-screen video the player
never leaves D-pad mode, so the click went to the picture.

So in D-pad mode on a transparent-cursor set a click is OK when travel is
under DPAD_MOTION_GATE (the existing 120 px, now named) or when it lands on
no control. A click on a control after real travel is still that control's.

Device check, same set: arrowed to Subtitles, the Info tab and ...
with the remote moving; each OK opened the focused control. Pointing at a
disc and clicking it still opened that disc, and a pointer click on bare
video still paused.

Signed-off-by: Dimitrije Juras <[email protected]>
@GLinnik21
GLinnik21 enabled auto-merge (squash) October 15, 2026 23:23
@chriskoperdraad-tech

Copy link
Copy Markdown

Hi @dimitrije83, I wrote #655, the transparent-cursor fix this builds on. First, sorry: we missed this. When testing #655 on my C7V (also webOS 3.9.3) we checked that the pointer hides on a D-pad press and comes back on movement, but we never pressed OK after D-pad navigation while it was hidden. Thanks for finding it and digging in.

Why #781's condition never held. That part comes from #655. show_cursor_after_motion() runs on the first SDL_MOUSEMOTION while cur_hidden is set, so any motion at all restores the cursor and clears cur_hidden. The jiggle of pressing OK is enough, and it arrives before the click.

An idea. When testing #655, I noticed that LG's own idle hide (SDL_WEBOS_CURSOR_SLEEP_TIME) only wakes the pointer on a deliberate movement; a small one does not bring it back. The transparent-cursor path is stricter than LG here: it re-shows on any motion. So the re-show could get a threshold. Keep the cursor transparent, and cur_hidden set, until the pointer has moved a net distance from where it was when hidden (displacement, not summed travel), say a few tens of px. Then pressing OK neither flashes the pointer nor clears cur_hidden, and #781's simple rule could hold again.

Measuring displacement instead of mot_accum's summed travel might also help with the drift you measured. A hand holding the remote jitters around one point, so summed travel keeps growing (your 159–600 px) while net displacement may stay small. I have not measured that, so logging both side by side would tell.

Two cases I see in #803's rule, as I read it:

  1. After drift of 120 px or more, if the pointer drifted onto a different control, the click goes to that control rather than the focused one.
  2. In the player, D-pad mode is never left, so after any D-pad press a deliberate click on bare video becomes OK on the focused control. That may well be fine, but it is worth knowing.

I have the same firmware, so I'm happy to test #803, or a displacement-threshold variant, on my set and post the event-log results if that would help.

@GLinnik21
GLinnik21 merged commit 64a3e32 into plxnative:main Oct 18, 2026
13 checks passed
@chriskoperdraad-tech

Copy link
Copy Markdown

@GLinnik21 @dimitrije83, I tested #803 on a second webOS 3.9.3 set: LG OLED C7V (2017, M16P), nightly 0.9.0-nightly-20261018, which contains #803.

  • Player: Up, Up, Right, Right to …, then OK. The More overlay opened (overlay=more), no pause.
  • Player: held Right to scrub, then OK. scrub: target taken 752s, and it jumped there, so Player: a key scrub waits for OK — click to confirm where to jump #809's confirm works with OK on this set.
  • Pointer: moved the remote and clicked the timeline. scrub: pointer commit, and it jumped; pointer clicks still go where they point.
  • Home: arrows to a card, then OK, opened it.

No crashes in the session. Thanks both!

RichiL10 added a commit to RichiL10/plx-native that referenced this pull request Oct 18, 2026
Brings the four upstream commits after the 0.9 base 0b0b220:
- plxnative#831 Watchlist: a plex.tv Watchlist tab, catalog page, Detail and hold-menu controls
- plxnative#803 input: a click with no control under it is OK after D-pad navigation
- plxnative#832 Route: a remux declares the source frame rate in the Load
- plxnative#833 tools: make test-crate works on the stable toolchain

One conflict, in the rebuilt-route projection of route/decision.rs: upstream now
declares `video_copy_fps(&applied.contract, p.src_fps)` where the fork had 0, and
clears Dolby Vision where the fork keeps the source's declaration on an HEVC video
copy. Resolved with upstream's rate line and the fork's Dolby Vision block, whose
else-branch clears Dolby Vision exactly as upstream does. No other fork code sets
the stream rate, so every copying remux now follows upstream's rule.
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.

3 participants