Repository navigation
fix(autostart): wait for interactive desktop before falling back to CLI - #193
Merged
dongle-china merged 2 commits intoNov 16, 2026
Merged
Conversation
📝 Contributor agreement requiredThank you for opening this pull request! Before CI can run, please sign the SniShaper contributor agreement. Reply to this pull request with a comment containing the word agree (e.g. "I agree") to confirm that you have read and accept:
Once you reply, the |
dongle-china
enabled auto-merge (squash)
November 16, 2026 12:02
Contributor
|
agree |
|
🔓 CI gate unlocked by maintainer |
dongle-china
force-pushed
the
fix/autostart-wait-desktop
branch
from
November 16, 2026 12:18
c2abd59 to
f91e9c7
Compare
The secrets context cannot be referenced in a job-level if: the workflow fails to start with no jobs scheduled. Detect fork PRs via github.event.pull_request.head.repo.fork instead; it is null on push events, so direct runs keep the syntax-bot reporting. Co-authored-by: SniShaper <SniShaper@proton.me>
Contributor
|
感谢修复此问题,我们将会在检查通过后合并。 |
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 #192
During the early logon phase, the interactive desktop is not yet ready. As a result,
OpenInputDesktopinsideNonInteractiveSession()fails and returns0, causing the app to incorrectly assume it is running in a headless environment (like session 0 or winget validation).Because of this misjudgment, the process takes the CLI fallback branch (
os.Exit(cliapp.Run(...))) inmain.goimmediately after launch. This preventsapp.NewApp()and Wails from ever initializing, which leaves the user with no tray icon, no WebView2 initialization, and no proxy running.This is especially problematic for the "silent startup" (Hidden: true) configuration, where the user gets zero visual feedback about the crash.
Fix
Add a bounded wait loop in
main.gospecifically when launched with the--startupargument:--startupis present andNonInteractiveSession()returns true, poll every 500ms (up to 30 seconds) until the desktop is actually ready.This change does not affect normal manual launches (where the desktop is already ready), explicit CLI commands, or non-Windows platforms.