Skip to content
Snippets Groups Projects
Commit 33391f42 authored by George Kiagiadakis's avatar George Kiagiadakis
Browse files

simple-policy: select by default the first non-loopback device

This is a bit of a hack, temporarily needed for AGL.
parent d6f6c3d6
No related branches found
No related tags found
No related merge requests found
......@@ -164,6 +164,21 @@ simple_policy_endpoint_added (WpPolicy *policy, WpEndpoint *ep)
if (!self->selected[direction]) {
select_endpoint (self, direction, ep, control_id);
} else {
/* we already have a selected endpoint, but maybe this one is better... */
const gchar *new_name = wp_endpoint_get_name (ep);
const gchar *old_name = wp_endpoint_get_name (self->selected[direction]);
/* FIXME: this is a crude way of searching for properties;
* we should have an API here */
if ((strstr (new_name, "hw:0,0") && !strstr(new_name, "Loopback")) ||
(strstr (old_name, "Loopback") && strstr (new_name, "hw:1,0")))
{
wp_endpoint_set_control_value (self->selected[direction],
self->selected_ctl_id[direction],
g_variant_new_boolean (FALSE));
select_endpoint (self, direction, ep, control_id);
}
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment