Repository navigation
wayland/webos: send the cursor visibility only when it changes - #17
Open
mgonzalez01 wants to merge 1 commit into
Open
mgonzalez01 wants to merge 1 commit into
mgonzalez01 wants to merge 1 commit into
Conversation
Wayland_ShowCursor() runs on every mouse focus change and asked the compositor to show the pointer each time. When LG's screensaver takes focus over an app that allows it, that request ends the screensaver within a second: on an LG OLED55G2 (webOS 25) with an SDL3 window and SDL_HINT_VIDEO_ALLOW_SCREENSAVER, tvpower went from Screen Saver back to Active after 43 ms with no input. Sending only changes, as SDL2-webOS did, keeps the screensaver up. SDL_webOSCursorVisibility() still sends every request it is given. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
On an LG TV, an SDL3 app that allows the screensaver (
SDL_HINT_VIDEO_ALLOW_SCREENSAVER) never sees LG's screensaver stay up: it starts after the TV's idle timer and ends again within a second, with no input. On an OLED it shows as a short black flash every few minutes.Wayland_ShowCursor()callsWaylandWebOS_SetCursorVisibility(mouse->cursor_visible)on every cursor redraw, and SDL redraws the cursor on every mouse focus change. When the screensaver comes up, the app's window loses mouse focus, SDL asks the compositor to show the pointer again, and the screensaver ends. Apps that block the screensaver, SDL's default, never see this, which is probably why it hasn't come up with games.This adds
WaylandWebOS_UpdateCursorVisibility(), which sends the request only when it differs from what was last sent (the existingcursor_hiddenstate), as SDL2-webOS did, and uses it inWayland_ShowCursor().SDL_webOSCursorVisibility()still sends every request it's given.Tested
LG OLED55G2, webOS 10.3.1 (
Rockhopper release 10.3.1-3001), with the minimal app below: an SDL3 window that allows the screensaver and clears itself 10 times a second. The same binary and package each run; onlylibSDL3.so.0differs. Lines from the TV's/var/log/messages, whose timestamps are seconds since boot.release-3.4.16-webos.5as is: the screensaver lasts 43 ms.The app logged
SDL_EVENT_WINDOW_MOUSE_LEAVEandSDL_EVENT_WINDOW_FOCUS_LOSTat 16511.67, thenSDL_EVENT_WINDOW_FOCUS_GAINEDandSDL_EVENT_WINDOW_MOUSE_ENTERat 16512.03.With this commit (the library reports
SDL-3.4.16-release-3.4.16-webos.5-1-gb33e293): the screensaver stays.tvpower, polled twice a second, still said
Screen Saver119 s later, when the run ended. An earlier version of the change held the same way, and so does a larger app that showed the flash every few minutes before. One more difference: with the release, the window receives a mouse enter right at startup, and with this commit it doesn't, since nothing tells the compositor "visible" at init any more. The magic remote's pointer still appears over the window as soon as the remote moves.Only tested on this one TV.
The test app
Built with webosbrew's toolchain against SDL-webOS, and packaged with
libSDL3.so.0inlib/next tobin/(rpath$ORIGIN/../lib). It writes/tmp/sdlrepro.log.WAYLAND_DEBUGprinted nothing on this TV.