rem: if (icon->y_pos < 0) icon->y_pos = 0; else if (icon->y_pos > scr->scr_height-ICON_SIZE) icon->y_pos = scr->scr_height-ICON_SIZE;  if (icon->x_pos < 0) icon->x_pos = 0; else if (icon->x_pos > scr->scr_width-ICON_SIZE) icon->x_pos = scr->scr_width-ICON_SIZE;
add: rect.pos.x = icon->x_pos; rect.pos.y = icon->y_pos; rect.size.width = rect.size.height = ICON_SIZE;  wGetRectPlacementInfo(scr, rect, &flags); if (flags & (XFLAG_DEAD | XFLAG_PARTIAL)) wScreenKeepInside(scr, &icon->x_pos, &icon->y_pos, ICON_SIZE, ICON_SIZE);
context: wClipRestoreState(WScreen *scr, WMPropList *clip_state){    WAppIcon *icon;    WMPropList *value;    icon = mainIconCreate(scr, WM_CLIP);    if (!clip_state)	return icon;    else        WMRetainPropList(clip_state);    /* restore position */    value = WMGetFromPLDictionary(clip_state, dPosition);    if (value) {	if (!WMIsPLString(value))	    COMPLAIN("Position");	else {	    if (sscanf(WMGetFromPLString(value), "%i,%i", &icon->x_pos,		       &icon->y_pos)!=2)		COMPLAIN("Position");	    /* check position sanity */	    if (icon->y_pos < 0)		icon->y_pos = 0;	    else if (icon->y_pos > scr->scr_height-ICON_SIZE)                icon->y_pos = scr->scr_height-ICON_SIZE;            if (icon->x_pos < 0)                icon->x_pos = 0;            else if (icon->x_pos > scr->scr_width-ICON_SIZE)                icon->x_pos = scr->scr_width-ICON_SIZE;	}    }#ifdef OFFIX_DND    value = WMGetFromPLDictionary(clip_state, dDropCommand);    if (value && WMIsPLString(value))	icon->dnd_command = wstrdup(WMGetFromPLString(value));#endif        value = WMGetFromPLDictionary(clip_state, dPasteCommand);    if (value && WMIsPLString(value))	icon->paste_command = wstrdup(WMGetFromPLString(value));        WMReleasePropList(clip_state);    return icon;}