/* Only keep await status if focus event is to an ancestor of the await * region. */ static void check_clear_await(WRegion *reg) { if(region_is_await(reg) && reg!=(WRegion*)await_watch.obj) return; watch_reset(&await_watch); }
void region_set_await_focus(WRegion *reg) { if(reg==NULL){ watch_reset(&await_watch); }else{ watch_setup(&await_watch, (Obj*)reg, (WatchHandler*)await_watch_handler); } }
void grouppholder_do_unlink(WGroupPHolder *ph) { WGroup *group=ph->group; watch_reset(&(ph->stack_above_watch)); if(ph->recreate_pholder!=NULL){ if(ph->next!=NULL){ ph->next->recreate_pholder=ph->recreate_pholder; }else{ /* It might be in use in attach chain! So defer. */ mainloop_defer_destroy((Obj*)ph->recreate_pholder); } ph->recreate_pholder=NULL; } if(group!=NULL){ UNLINK_ITEM(group->phs, ph, next, prev); }else if(ph->prev!=NULL){ WGroupPHolder *next=ph->next; ph->prev->next=next; if(next==NULL){ next=get_head(ph); assert(next->prev==ph); } next->prev=ph->prev; }else{ /* ph should not be on a list, if prev pointer is NULL (whereas * next alone can be NULL in our semi-doubly-linked lists). */ assert(ph->next==NULL); } ph->group=NULL; ph->next=NULL; ph->prev=NULL; }
static void free_node(ObjList **objlist, ObjList *node) { watch_reset(&(node->watch)); UNLINK_ITEM(*objlist, node, next, prev); free(node); }