rem: if (ex_y >= 0 && ex_y <= max_y_icons && (aicon == icon || !aicon)) {
add: if (ex_y>=0 && ex_y<=max_y_icons && (aicon==icon || !aicon)) { *ret_x = 0;
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;    WAppIcon *aicon = NULL;    WAppIcon *nicon = NULL;    int max_y_icons, max_x_icons;    max_x_icons = scr->scr_width/ICON_SIZE;    max_y_icons = scr->scr_height/ICON_SIZE-1;    if (wPreferences.flags.noupdates)	return False;    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;    /* check if the icon is outside the screen boundaries */    if (dx + ex_x*ICON_SIZE < -ICON_SIZE+2 ||	dx + ex_x*ICON_SIZE >= scr->scr_width-1 ||	dy + ex_y*ICON_SIZE < -ICON_SIZE+2 ||	dy + ex_y*ICON_SIZE >= scr->scr_height-1)	return False;    if (dock->type == WM_DOCK) {	if (icon->dock != dock && ex_x != 0)	    return False;	for (i=0; i<dock->max_icons; i++) {	    nicon = dock->icon_array[i];	    if (nicon && nicon->yindex == ex_y) {		aicon = nicon;		break;	    }	}	*ret_x = 0;	if (redocking) {	    int sig, done, closest;	    /* Possible cases when redocking:	     *	     * icon dragged out of range of any slot -> false	     * icon dragged to range of free slot	     * icon dragged to range of same slot	     * icon dragged to range of different icon	     */	    if (abs(ex_x) > DOCK_DETTACH_THRESHOLD)		return False;	    if (ex_y >= 0 && ex_y <= max_y_icons && (aicon == icon || !aicon)) {		*ret_y = ex_y;		return True;	    }	    /* start looking at the upper slot or lower? */	    if (ex_y*ICON_SIZE < (req_y + offset - dy))		sig = 1;	    else		sig = -1;	    closest = -1;	    done = 0;	    /* look for closest free slot */	    for (i=0; i<(DOCK_DETTACH_THRESHOLD+1)*2 && !done; i++) {		int j;		done = 1;		closest = sig*(i/2) + ex_y;		/* check if this slot is used */		if (closest >= 0) {		    for (j = 0; j<dock->max_icons; j++) {			if (dock->icon_array[j] 			    && dock->icon_array[j]->yindex==closest) {			    /* slot is used by someone else */			    if (dock->icon_array[j]!=icon)				done = 0;			    break;			}		    }		}		sig = -sig;	    }	    if (done && closest >= 0 && closest <= max_y_icons &&		((ex_y >= closest && ex_y - closest < DOCK_DETTACH_THRESHOLD+1)		||		 (ex_y < closest && closest - ex_y <= DOCK_DETTACH_THRESHOLD+1))) {		*ret_y = closest;		return True;	    }	} else { /* !redocking */	    /* if slot is free and the icon is close enough, return it */	    if (!aicon && ex_x == 0 && ex_y >= 0 && ex_y <= max_y_icons) {		*ret_y = ex_y;		return True;	    }	}    } else { /* CLIP */	int neighbours = 0;	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;	    }	}		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 (neighbours && (aicon==NULL || (redocking && aicon == icon))) {	    *ret_x = ex_x;	    *ret_y = ex_y;	    return True;	}    }    return False;}