Skip to content

Commit

Permalink
Fix default toggle on input sources.
Browse files Browse the repository at this point in the history
  • Loading branch information
saivert committed Jul 5, 2024
1 parent 4708431 commit 70df871
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
1 change: 0 additions & 1 deletion src/ui/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ mod route_dropdown;
mod volumescale;

pub use window::PwvucontrolWindow;
pub use window::PwvucontrolWindowView;
pub use profile_dropdown::PwProfileDropDown;
pub use withdefaultlistmodel::WithDefaultListModel;
pub use volumebox::{PwVolumeBox, PwVolumeBoxImpl};
Expand Down
5 changes: 3 additions & 2 deletions src/ui/volumebox.rs
Original file line number Diff line number Diff line change
Expand Up @@ -124,8 +124,9 @@ mod imp {

let defaultnodesapi = manager.default_nodes_api();
let widget = self.obj();
let defaultnodesapi_closure = closure_local!(@watch widget => move |defaultnodesapi: wp::plugin::Plugin| {
let id: u32 = defaultnodesapi.emit_by_name("get-default-node", &[&"Audio/Sink"]);
let defaultnodesapi_closure = closure_local!(@watch widget, @strong item => move |defaultnodesapi: wp::plugin::Plugin| {
let media_class: String = item.node_property("media.class");
let id: u32 = defaultnodesapi.emit_by_name("get-default-node", &[&media_class]);
wp::info!("default-nodes-api changed: new id {id}");
widget.imp().default_node.set(id);

Expand Down

0 comments on commit 70df871

Please sign in to comment.