rem: if (XGetCommand(dpy, wwin->client_win, &argv, &argc) && argc>0) {  icon->command = wtokenjoin(argv, argc); XFreeStringList(argv);
add: command = GetCommandForWindow(wwin->client_win); if (command) { icon->command = command;
context: moveIconBetweenDocks(WDock *src, WDock *dest, WAppIcon *icon, int x, int y){    WWindow *wwin;    char **argv;    int argc;    int index;    if (src == dest)        return True;     /* No move needed, we're already there */    if (dest == NULL)        return False;    wwin = icon->icon->owner;    /*     * For the moment we can't do this if we move icons in Clip from one     * workspace to other, because if we move two or more icons without     * command, the dialog box will not be able to tell us to which of the     * moved icons it applies. -Dan     */    if ((dest->type==WM_DOCK /*|| dest->keep_attracted*/) && icon->command==NULL) {        if (XGetCommand(dpy, wwin->client_win, &argv, &argc) && argc>0) {            icon->command = wtokenjoin(argv, argc);            XFreeStringList(argv);        } else {            char *command=NULL;	    icon->editing = 1;/*            icon->forced_dock = 1;*/            if (wInputDialog(src->screen_ptr, _("Dock Icon"),			     _("Type the command used to launch the application"),                             &command)) {                if (command && (command[0]==0 ||                                (command[0]=='-' && command[1]==0))) {                    wfree(command);                    command = NULL;                }                icon->command = command;            } else {		icon->editing = 0;		if (command)		    wfree(command);		return False;            }	    icon->editing = 0;        }    }    if (dest->type == WM_DOCK)        wClipMakeIconOmnipresent(icon, False);    for(index=1; index<src->max_icons; index++) {        if(src->icon_array[index] == icon)            break;    }    assert(index < src->max_icons);    src->icon_array[index] = NULL;    src->icon_count--;    for(index=1; index<dest->max_icons; index++) {        if(dest->icon_array[index] == NULL)            break;    }    /* if (index == dest->max_icons)        return; */    assert(index < dest->max_icons);    dest->icon_array[index] = icon;    icon->dock = dest;    /* deselect the icon */    if (icon->icon->selected)        wIconSelect(icon->icon);    if (dest->type == WM_DOCK) {        icon->icon->core->descriptor.handle_enternotify = NULL;        icon->icon->core->descriptor.handle_leavenotify = NULL;    } else {        icon->icon->core->descriptor.handle_enternotify = clipEnterNotify;        icon->icon->core->descriptor.handle_leavenotify = clipLeaveNotify;    }    /* set it to be kept when moving to dock.     * Unless the icon does not have a command set     */    if (icon->command && dest->type==WM_DOCK) {	icon->attracted = 0;	if (icon->icon->shadowed) {	    icon->icon->shadowed = 0;	    icon->icon->force_paint = 1;	}    }    if (src->auto_collapse || src->auto_raise_lower)        clipLeave(src);    icon->yindex = y;    icon->xindex = x;    icon->x_pos = dest->x_pos + x*ICON_SIZE;    icon->y_pos = dest->y_pos + y*ICON_SIZE;    dest->icon_count++;    MoveInStackListUnder(dest->icon_array[index-1]->icon->core,                         icon->icon->core);    wAppIconPaint(icon);    return True;}