Repository navigation
webOS 3.x: hide the Magic Remote pointer on D-pad presses and after 5 s idle (#642) - #655
Merged
GLinnik21 merged 6 commits intoOct 14, 2026
Conversation
…L_webOS* extension webOS 3.9.3 ships SDL 2.0.4 with no SDL_webOS* export at all, so the runtime lookup of SDL_webOSCursorVisibility from plxnative#578 returned None and every hide_cursor() was a no-op. The Magic Remote pointer then stayed on screen until LG's own ~5-minute idle timeout, including over video. That SDL draws the pointer itself (cursorType*.png, wl_starfish_pointer), so hide_cursor() now falls back to SDL_ShowCursor(SDL_DISABLE) when the LG extension is absent, and pointer motion re-enables it with SDL_ShowCursor(SDL_ENABLE), since nothing in the compositor brings a cursor hidden that way back. SDL_ShowCursor is dlsym'd as well, so the binary gains no import. Sets with the LG extension (webOS 4+) take the unchanged path. The resolved door is logged once as "cursor: ...". Fixes plxnative#642. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: chriskoperdraad-tech <[email protected]>
…rsor Measured on a webOS 3.9.3 set: SDL_ShowCursor(SDL_DISABLE) hides LG's SDL-drawn pointer, but pointer motion then stops reaching the app until the pointer re-enters the window (only opening and closing the Settings overlay did it), so the motion that was meant to re-enable the cursor never arrived and the pointer stayed hidden. hide_cursor() on that path now swaps SDL's cursor for a transparent 8x1 one (SDL_CreateCursor with every data and mask bit clear) and keeps the cursor it replaced; the next motion puts it back with SDL_SetCursor. Motion keeps flowing because the window still has a cursor. Verified on the same set with an instrumented build: every D-pad hide and every playback idle hide was followed by a motion that restored the pointer, and the pointer was invisible in between. All four SDL calls are dlsym'd, so the binary still gains no import. Sets with LG's extension (webOS 4+) are unchanged. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: chriskoperdraad-tech <[email protected]>
…ault Without LG's SDL_webOS* extension, LG's SDL hides its own pointer after SDL_WEBOS_CURSOR_SLEEP_TIME of stillness, and its default is about five minutes (timed on a webOS 3.9.3 set, plxnative#642), so on menus the pointer stayed up far longer than in any other app on that television. Set the hint to 5000 before SDL_Init where SDL_webOSCursorVisibility is absent. Measured on the same set with an instrumented build: the unit is milliseconds, 5000 hides a still pointer after about five seconds, and a deliberate movement brings it back. webOS 4+ does not get the hint. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: chriskoperdraad-tech <[email protected]>
…store, test the hide/show bookkeeping, fix stale docs hide_cursor now takes its function table through hide_through/show_through, so the host can grade the bookkeeping with fake extern "C" functions: the transparent cursor is installed, the previous (or default) cursor is the one motion restores, a second hide keeps it, and LG's extension door is called with 0. When SDL_GetCursor and SDL_GetDefaultCursor both answer NULL nothing is saved to restore, so the swap is skipped instead of leaving the pointer invisible for good. The idle-hide hint decision is a pure function, and a seam-order test pins that it is set before SDL_Init. note_global_press, docs/remote-keys.md and Pointer::cur_hidden said hide_cursor names a webOS-only symbol that fails a host test at ld; since plxnative#578 it resolves through dlsym, and the hider may be a transparent SDL cursor rather than LG's. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
GLinnik21
enabled auto-merge (squash)
October 14, 2026 14:07
Collaborator
|
Merged, thank you @chriskoperdraad-tech! Great work. |
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.
Fixes #642.
Tested on an LG OLED C7V (2017), webOS 3.9.3 (
dreadlocks2-dudhwa, M16P), rooted with Homebrew Channel. I used debug builds from this branch's CI, installed beside PlxNative Nightly.What was wrong
The system SDL on this set is 2.0.4 and exports no
SDL_webOS*symbols at all. So since #578 the runtime lookup ofSDL_webOSCursorVisibilityreturnsNone, and everyhide_cursor()was a no-op. The pointer then stayed on screen, over video too, until LG's SDL hid it by itself. That happens after about five minutes of stillness (timed).That SDL draws the pointer itself. Its strings include
/usr/share/im/cursorType*.png,wl_starfish_pointerand anSDL_WEBOS_CURSOR_SLEEP_TIMEhint.What does not work:
SDL_ShowCursorMy first suggestion in the issue was
SDL_ShowCursor(SDL_DISABLE), thenSDL_ENABLEon motion. On this set that hides the pointer, but it also stops pointer motion from reaching the app until the pointer re-enters the window. The only thing that did that was opening and closing the Settings overlay. With the pointer hidden this way, sweeping the remote across several cards (far more than the 120 px D-pad gate) did not move focus. So the motion that was meant to bring the cursor back never arrived.The change
hide_cursor()without LG's extension swaps SDL's cursor for a transparent one instead of switching it off. That is an 8x1SDL_CreateCursorwith every data and mask bit clear. It keeps the cursor it replaced, andshow_cursor_after_motion()(new, called from theSDL_MOUSEMOTIONarm whilecur_hidden) puts it back withSDL_SetCursor. Because the window still has a cursor, motion keeps arriving.SDL_SetCursor,SDL_GetCursor,SDL_GetDefaultCursorandSDL_CreateCursorare alldlsym'd likeSDL_webOSCursorVisibility, so the binary gains no import. The door is resolved once, on the first hide (afterSDL_Init), and logs which path it took (cursor: ...).SDL_WEBOS_CURSOR_SLEEP_TIMEof stillness, and its default is about five minutes. That is the "hides late" in the issue title, and what a viewer sees on every menu. The app now sets the hint to5000beforeSDL_Init, only whereSDL_webOSCursorVisibilityis absent. I measured the unit with a build that read the value from a dev trigger: it is milliseconds, and5000hid a still pointer after about five seconds. A deliberate movement brings it back; a small one does not, which looks like LG's own wake threshold. It is its own commit, to keep the two mechanisms apart in review.On webOS 4+ nothing should change at runtime.
SDL_webOSCursorVisibilityresolves there, so the cursor path is the same LG call as before, and the hint is not set.Verification
PointerHidden, 484, arrives in the event log) and returns on movement.cursor: SDL_WEBOS_CURSOR_SLEEP_TIME=5000 (no SDL_webOS* in this SDL)andcursor: transparent SDL cursor (no SDL_webOS* in this SDL).hide_cursor()path the instrumented build exercised, but I did not separately re-run it on this exact build.Not changed
The doc comment above
note_global_pressinapp/input.rs, and theis_boundparagraph indocs/remote-keys.md, still sayhide_cursornames a webOS-only SDL symbol, so a host test that reaches it fails atld. That has not been true since #578 resolved it at runtime, and it still isn't. I left both alone to keep this change to the cursor itself.🤖 Generated with Claude Code