moonlight: fix pairing UI freeze, add cancel and streaming settings - #22
Open
xiaodoudou wants to merge 1 commit into
Open
xiaodoudou wants to merge 1 commit into
xiaodoudou wants to merge 1 commit into
Conversation
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.
Summary
moonlight.confover SSH.Six changes:
moonlight pairprints nothing and does not exit until the host accepts the PIN, and it was run on the UI thread, so ES locked up completely with no feedback. I thought my device had crashed. It now runs throughGuiLoading, like other slow jobs already do, with the PIN shown on screen while you wait.GuiLoadingtakes an optional cancel callback as a fifth argument, defaulting tonullptr, so no existing caller changes behaviour. It kills the pairing process rather than closing the dialog itself, which lets the worker thread finish and the normal completion path clean up.GuiSettings::save()returns early when the menu has registered no save function, and this one had none, so the IP reachedsystem.cfgonly if another menu happened to flush it.PAIRbefore ever seeing it. It now sits withSERVER IPunderSETTINGS, leavingPAIRINGfor the two actions.moonlight.confin place, so comments and keys the menu does not manage are left alone. Bitrate defaults toAUTO(-1), letting moonlight work the rate out from resolution and fps, which suits the range of ROCKNIX devices better than a fixed number.isEmbedded()fixed. It checksmoonlight -voutput for the word "Embedded", butss << mlverwrites the pipe handle's address instead of reading through it, so the check always failed. The pipe was never closed either, leaving a zombiemoonlight -vbehind on every visit to the menu.New layout:
Testing
How was this tested? Cross-compiled for aarch64 and run on an AYN Odin 2 (SM8550), ROCKNIX 20260701, with the binary bind-mounted over
/usr/bin/emulationstationso it was easy to put back.moonlight.confagainst a copy taken beforehand.Test results: Pairing works, with the PIN on screen throughout and the menu still responsive. Backing out really does stop it, leaving nothing behind (
pgrep -af moonlightreturns nothing).The config write touched only the two values I changed:
Comment count was identical before and after, and
platform,quitappafterand the commented-out#addressline were untouched. Build is clean with no new warnings.Not covered: I built against Debian bookworm rather than a ROCKNIX toolchain, so CI here is the proper check. I only have one device, so the smaller-screen resolution presets could use another opinion. I also did not re-test that the server IP survives a restart, or check the back button on the other loading screens.
Additional Context
GuiLoading.his the only shared file touched, so it is worth the closest look. Existing callers cannot be affected, since the old constructor took four arguments and all 22 of them pass four or fewer, so they getnullptrand fall through to the originalreturn false. Easy check anyway: open the Wi-Fi scan or BIOS check and confirm the back button still does nothing.isEmbedded()working,QT_QPA_PLATFORM=waylandis no longer prefixed on Embedded builds, which is every device, sincedistributionalways builds Embedded. It did nothing there, so I do not expect a regression, but it is a change rather than a pure fix./storage/.config/Moonlight Game Streaming Project/), and kept the misspelled"Succesfully paired"check, since that is what Embedded actually prints.AI Usage
While ROCKNIX doesn't have restrictions on AI tools in contributing, please be transparent about their usage as it
helps set the right context for reviewers.
Did you use AI tools to help write this code? YES
Reviewed with Claude Code. I also used it to automate the local build so I could test this on device, and to look back over the change for anything worth improving.