rem: list_remove_head(&selectedIcons);
context: switchWSCommand(WMenu *menu, WMenuEntry *entry){    WAppIcon *btn, *icon = (WAppIcon*) entry->clientdata;    WScreen *scr = icon->icon->core->screen_ptr;    WDock *src, *dest;    LinkedList *selectedIcons;    int x, y;    if (entry->order == scr->current_workspace)        return;    src = icon->dock;    dest = scr->workspaces[entry->order]->clip;    selectedIcons = getSelected(src);    if (selectedIcons) {        while(selectedIcons) {            btn = selectedIcons->head;            if (wDockFindFreeSlot(dest, &x, &y)) {                moveIconBetweenDocks(src, dest, btn, x, y);                XUnmapWindow(dpy, btn->icon->core->window);            }            list_remove_head(&selectedIcons);        }    } else if (icon != scr->clip_icon) {        if (wDockFindFreeSlot(dest, &x, &y)) {            moveIconBetweenDocks(src, dest, icon, x, y);            XUnmapWindow(dpy, icon->icon->core->window);        }    }}