File tree Expand file tree Collapse file tree 1 file changed +17
-0
lines changed Expand file tree Collapse file tree 1 file changed +17
-0
lines changed Original file line number Diff line number Diff line change @@ -405,6 +405,23 @@ impl Model {
405405 }
406406
407407 pipewire:: Event :: ActiveProfile ( id, profile) => {
408+ // If the profile was automatically set to Off, auto-select the first available profile.
409+ if self . last_set_profile != Some ( ( id, 0 ) ) && profile. index == 0 {
410+ if let Some ( profiles) = self . device_profiles . get ( id) {
411+ for profile in profiles {
412+ if profile. index != 0
413+ && profile. name != "pro-audio"
414+ && !matches ! ( profile. available, Availability :: No )
415+ {
416+ let index = profile. index as u32 ;
417+ tokio:: spawn ( async move {
418+ set_profile ( id, index) . await ;
419+ } ) ;
420+ }
421+ }
422+ }
423+ }
424+
408425 let index = profile. index as u32 ;
409426 self . active_profiles . insert ( id, profile) ;
410427 self . update_ui_profiles ( ) ;
You can’t perform that action at this time.
0 commit comments