fix: keep the output device the user picked in Volume Control - #2097
Merged
Conversation
The picker shows a "Choose a device" prompt while SysManager cannot read where
Windows is sending an app, which is every app today. Choosing a device routed the
app but never cleared that flag, so the prompt stayed painted over the chosen name
and the tab's ten-second device re-read then snapshotted the row as unrouted and
blanked the picker, discarding the only record of what the user had set.
A successful write now settles the flag: SysManager knows the route because it is
what set it. A refused write leaves the flag alone, since nothing moved.
Introduced in v1.76.7 with the three-state route flag -- before it the refresh
snapshot read the selection directly and a hand-made pick survived. README already
documented the fixed behaviour ("each app keeps the destination you picked for it").
Two regression tests, both red before this change: the flag one on the prompt
overprinting, the refresh one on "Expected {hdst}, Actual null".
Closes #2096
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.
Closes #2096.
What was wrong
OutputRouteUnknowndrives the picker's "Choose a device" placeholder, andOnSelectedOutputDeviceChangednever cleared it after a successful write. Two consequences:TextBlockshares itsGridcell with theComboBoxatMargin="10,0,0,0"— where the box draws its selected item — so the prompt was painted over the name the user picked.RefreshDevicesAsyncsnapshots each row asOutputRouteUnknown ? null : id. A row still flagged unknown snapshotted asnulland was re-applied asnull, so the picker blanked on the tenth reconcile pass, about ten seconds after the choice. Windows kept the route; the UI forgot it, leaving the user no way to see or undo what they set.Every routable app on every machine, because the route read is still a stub returning null (#2088).
Introduced in v1.76.7 with the three-state flag. Before it the snapshot read the selection directly and a hand-made pick survived — a regression, not a long-standing gap.
The fix
A successful write settles the flag: SysManager knows the route because it is what set it. A refused write leaves it alone, because nothing moved.
Verification
Red-before / green-after, both tests, mutation = the pre-fix shape of
OnSelectedOutputDeviceChanged:AUserPickedDevice_IsNoLongerAnUnknownRouteFalseException— the flag stays up, so the prompt covers the chosen nameAUserPickedDevice_SurvivesADeviceRefreshEqualException: Expected "{hdst}", Actual null— the pick is discardedBoth green after;
AnUnknownRoute_StaysUnknownAcrossADeviceRefreshandPuttingAnAppBackOnTheDefaultDevice_ClearsTheOverridestayed green throughout, so the unknown-route contract is intact.Regression sweep: 137 named tests across the audio suites and
ArchitectureTests— 152 cases, all green. Builds 0 errors / 0 warnings (app + tests),dotnet format --verify-no-changesclean on both, version consistency csproj 1.76.9 = CHANGELOG 1.76.9 = SECURITY 1.76.x.Docs
No README change needed — it already promises this behaviour ("the device list is re-read every ten seconds, and each app keeps the destination you picked for it"). The claim was false until this commit.