- PARA_INFO_LOG("activating %p (fd %d, filter node: %p)\n", gc, gc->fd, fn);
- list_del(&gc->node);
- para_list_add(&gc->fcb.node, &fn->callbacks);
+ struct btr_node *root = audiod_get_btr_root(), *parent;
+ char *name = gc->name? gc->name : "grab";
+
+ if (!root)
+ return;
+ parent = btr_search_node(gc->parent, root);
+ if (!parent)
+ return;
+ PARA_INFO_LOG("activating fd %d\n", gc->fd);
+ list_move(&gc->node, &active_grab_client_list);
+ gc->btrn = btr_new_node(&(struct btr_node_description)
+ EMBRACE(.name = name, .parent = parent));
+
+ gc->task = task_register(&(struct task_info) {
+ .name = name,
+ .pre_select = gc_pre_select,
+ .post_select = gc_post_select,
+ .context = gc,
+ }, s);