rem: if (dock->x_pos + ex_x*ICON_SIZE < -ICON_SIZE+2 || dock->x_pos + ex_x*ICON_SIZE > scr->scr_width-1 || dock->y_pos + ex_y*ICON_SIZE < -ICON_SIZE+2 || dock->y_pos + ex_y*ICON_SIZE > scr->scr_height-1) return False;
add: if (dock->type == WM_DOCK) { for (i=0; i<dock->max_icons; i++) { nicon = dock->icon_array[i]; if (nicon && nicon->yindex == ex_y) { aicon = nicon; break; } }
context: wDockSnapIcon(WDock *dock, WAppIcon *icon, int req_x, int req_y, 	      int *ret_x, int *ret_y, int redocking){    WScreen *scr = dock->screen_ptr;    int dx, dy;    int ex_x, ex_y;    int i, offset = ICON_SIZE/2;    int only_down = (dock->type == WM_DOCK);    WAppIcon *aicon = NULL;    WAppIcon *nicon = NULL;    dx = dock->x_pos;    dy = dock->y_pos;    /* if the dock is full */    if (!redocking &&        (dock->icon_count >= dock->max_icons)) {	return False;    }        /* exact position */    if (req_y < dy)        ex_y = (req_y - offset - dy)/ICON_SIZE;    else        ex_y = (req_y + offset - dy)/ICON_SIZE;    if (req_x < dx)        ex_x = (req_x - offset - dx)/ICON_SIZE;    else        ex_x = (req_x + offset - dx)/ICON_SIZE;    if ((ex_y < 1 || ex_x != 0) && only_down)        return False;    if (dock->x_pos + ex_x*ICON_SIZE < -ICON_SIZE+2 ||        dock->x_pos + ex_x*ICON_SIZE > scr->scr_width-1 ||        dock->y_pos + ex_y*ICON_SIZE < -ICON_SIZE+2 ||        dock->y_pos + ex_y*ICON_SIZE > scr->scr_height-1)        return False;    for (i=0; i<dock->max_icons; i++) {        nicon = dock->icon_array[i];        if (nicon && nicon->xindex == ex_x && nicon->yindex == ex_y) {            aicon = nicon;            break;        }    }    if (!only_down) {        int neighbours = 0;        for (i=0; i<dock->max_icons; i++) {            nicon = dock->icon_array[i];            if (nicon && nicon != icon && /* Icon can't be it's own neighbour */                (abs(nicon->xindex - ex_x) <= CLIP_ATTACH_VICINITY &&                 abs(nicon->yindex - ex_y) <= CLIP_ATTACH_VICINITY)) {                neighbours = 1;                break;            }        }        if ((!redocking && neighbours && !aicon) ||            (redocking && neighbours && (aicon == icon || !aicon))) {            *ret_x = ex_x;            *ret_y = ex_y;            return True;        }    }    else {        if ((!redocking && !aicon) ||            (redocking && (aicon==icon || !aicon))) {            *ret_x = 0;            *ret_y = ex_y;            return True;        }    }        return False;}