refactor: drop dead resolveGamescopePid, use helper MainPID directly (#37)#48
Open
hikaps wants to merge 1 commit into
Open
refactor: drop dead resolveGamescopePid, use helper MainPID directly (#37)#48hikaps wants to merge 1 commit into
hikaps wants to merge 1 commit into
Conversation
…37) LaunchInstance returns the gamescope MainPID (systemd-run ExecStart), but resolveGamescopePid searched the returned PID's *children* for a process named gamescope — so it always returned 0 and logged a spurious 'could not resolve gamescope PID' warning. The fallback already set m_gamescopePid to the correct value, so this only removes the misleading log line + ~32 lines of dead logic; behavior is unchanged.
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.
Removes a spurious, actively-misleading warning that surfaced in issue-28 logs (
Instance 0 could not resolve gamescope PID from helper PID …) and looked like a culprit for a missing second Steam instance.Root cause: dead logic, not a real failure
LaunchInstancereturns the gamescope MainPID directly — the transient unit's ExecStart is gamescope (systemd-run … -- gamescope <args> -- /bin/bash -c <game>,Type=simple). ButresolveGamescopePid()assumed the returned PID was a wrapper whose child is gamescope: it read/proc/<pid>/childrenand matchedcomm == gamescope. Gamescope's actual children arebash→the game, so it always returned 0 and logged the warning. The fallback on the next line already setm_gamescopePid = m_helperPid, i.e. the correct value.So
m_gamescopePid,WindowManagerpositioning, andSessionRunner::findSteamProcess()were all using the correct PID — the only effect was the false log line.Change
Delete
resolveGamescopePid(1 call site, 0 test refs) and assign directly:// The helper's LaunchInstance returns the gamescope MainPID directly. m_gamescopePid = m_helperPid;Behavior unchanged (the fallback already produced this value); −37 lines.
Verified
test_gamescopeinstance: 21 passed, 0 failed.Note: this does not fix the flatpak second-Steam-instance issue reported in #28 — that's flatpak-specific (host Steam coexisted fine in the native path), tracked separately.