rem: if (!icon->forced_dock) icon->main_window = window;
add: if (!icon->forced_dock) { icon->main_window = window; }
context: wDockTrackWindowLaunch(WDock *dock, Window window){    WAppIcon *icon;    char *wm_class, *wm_instance;    int i;    Bool firstPass = True;    Bool found = False;    char *command = NULL;    {	int argc;	char **argv;	if (XGetCommand(dpy, window, &argv, &argc)) {	    if (argc > 0 && argv != NULL)		command = wtokenjoin(argv, argc);	    if (argv) {		XFreeStringList(argv);	    }	}    }    if (!PropGetWMClass(window, &wm_class, &wm_instance) ||	(!wm_class && !wm_instance))	return;retry:    for (i=0; i<dock->max_icons; i++) {	icon = dock->icon_array[i];	if (!icon)	    continue;	/* app is already attached to icon */	if (icon->main_window == window) {	    found = True;	    break;	}	if ((icon->wm_instance || icon->wm_class)            && (icon->launching || !icon->running)) {	    if (icon->wm_instance && wm_instance &&		strcmp(icon->wm_instance, wm_instance)!=0) {		continue;	    }	    if (icon->wm_class && wm_class &&		strcmp(icon->wm_class, wm_class)!=0) {		continue;	    }	    if (firstPass && command && strcmp(icon->command, command)!=0) {		continue;	    }	    if (!icon->relaunching) {		WApplication *wapp;		/* Possibly an application that was docked with dockit,		 * but the user did not update WMState to indicate that		 * it was docked by force */		wapp = wApplicationOf(window);		if (!wapp) {		    icon->forced_dock = 1;		    icon->running = 0;		}		if (!icon->forced_dock)		    icon->main_window = window;	    }            found = True;            if (!wPreferences.no_animations && !icon->launching &&                !dock->screen_ptr->flags.startup && !dock->collapsed) {                WAppIcon *aicon;                int x0, y0;                icon->launching = 1;                dockIconPaint(icon);                aicon = wAppIconCreateForDock(dock->screen_ptr, NULL,                                              wm_instance, wm_class,                                              TILE_NORMAL);		/* XXX: can: aicon->icon == NULL ? */                PlaceIcon(dock->screen_ptr, &x0, &y0, wGetHeadForWindow(aicon->icon->owner));                wAppIconMove(aicon, x0, y0);                /* Should this always be lowered? -Dan */                if (dock->lowered)                    wLowerFrame(aicon->icon->core);                XMapWindow(dpy, aicon->icon->core->window);                aicon->launching = 1;                wAppIconPaint(aicon);                SlideWindow(aicon->icon->core->window, x0, y0,                            icon->x_pos, icon->y_pos);                XUnmapWindow(dpy, aicon->icon->core->window);                wAppIconDestroy(aicon);            }	    wDockFinishLaunch(dock, icon);	    break;	}    }    if (firstPass && !found) {	firstPass = False;	goto retry;    }    if (command)	wfree(command);    if (wm_class)	XFree(wm_class);    if (wm_instance)	XFree(wm_instance);}