static void do_destroy_thing(WThing *t) { WThing *p; p=t->t_parent; /* Make sure that any command sequence doesn't try to * access this thing anymore. */ query_check_function_thing(t); destroy_subthings(t); if(p!=NULL) CALL_FUNTAB(p, WThingFuntab, remove_child_fn)(p, t); grab_remove_for(t); unlink_thing(t); CALL_FUNTAB(t, WThingFuntab, deinit_fn)(t); free(t); if(wglobal.focus_next==t) wglobal.focus_next=NULL; if(wglobal.grab_holder==t) wglobal.grab_holder=NULL; if(wglobal.previous==t) wglobal.previous=p; }
static void do_remove_dockwin(WDock *dock, WClientWin *dw, bool subdest) { WClientWin *p; int num=0; int x, y; p=first_clientwin((WThing*)dock); while(p!=NULL){ if(p==dw) break; num++; p=next_clientwin(p); } if(p==NULL) return; x=dock->x; y=dock->y; XSelectInput(wglobal.dpy, dw->client_win, dw->event_mask&~StructureNotifyMask); XReparentWindow(wglobal.dpy, dw->client_win, SCREEN->root, x, y); XSelectInput(wglobal.dpy, dw->client_win, dw->event_mask); unlink_thing((WThing*)dw); dock->dockwin_count--; if(dock->dockwin_count==0 || subdest) return; shrink_dock(dock); }