Skip to content

Commit

Permalink
Delay setting nodeobject for route drop down.
Browse files Browse the repository at this point in the history
  • Loading branch information
saivert committed Jun 9, 2024
1 parent 4b55979 commit 332356b
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/ui/sinkbox.rs
Original file line number Diff line number Diff line change
Expand Up @@ -54,15 +54,15 @@ mod imp {

glib::idle_add_local_once(clone!(@weak self as widget => move || {
widget.obj().default_node_changed();
}));

let obj = self.obj();
let parent: &PwVolumeBox = obj.upcast_ref();
let node = parent.node_object().expect("nodeobj");

pwvucontrol_info!("sinkbox set_nodeobject {}", node.name());
// TODO: Hack! Associated PwDeviceObject for a sink type PwNodeObject may not have been added to model yet at this time.
// Delay the set_nodeobject call as workaround for now.
if let Some(node) = widget.obj().node_object() {
widget.route_dropdown.set_nodeobject(Some(node));
}
}));

self.route_dropdown.set_nodeobject(Some(node));
pwvucontrol_info!("sinkbox set_nodeobject {}", self.obj().node_object().expect("Node object").name());
}
}
impl WidgetImpl for PwSinkBox {}
Expand Down

0 comments on commit 332356b

Please sign in to comment.