rem: if (x < half_mask_width) { if (x < 0) x = 0; x0 = half_mask_width - x; w0  = Cursor_mask_width - x0;
add: if (x < Cursor_x_hot) {				 x0 = Cursor_x_hot - x; w0 = w - x0; }  if (displayWidth -1 < x - Cursor_x_hot + w) {	 w0 = (displayWidth) - (x - Cursor_x_hot); }  if (y < Cursor_y_hot) {				 y0 = Cursor_y_hot - y; h0 = h - y0;
context: magnifyGetImage(WMScreen *scr, int x, int y) {    XImage	*image;    Pixmap	pixmap;    int		x0, y0, w0, h0;    int		displayWidth = DisplayWidth(scr->display, scr->screen);    int		displayHeight = DisplayHeight(scr->display, scr->screen);    const int half_mask_width = (Cursor_mask_width +1)/2;    const int half_mask_height = (Cursor_mask_height +1)/2;        /* Coordinate correction for back pixmap      * if magnifying glass is at screen-borders */    x0 = 0; y0 = 0; w0 = Cursor_mask_width; h0 = Cursor_mask_height;        if (x < half_mask_width) {	if (x < 0) x = 0;	x0 = half_mask_width - x;	w0  = Cursor_mask_width - x0;    }        if (x > displayWidth - half_mask_width) {	if (x > displayWidth)  x = displayWidth;	w0 = Cursor_mask_width - (half_mask_width - (displayWidth - x));    }        if (y < half_mask_height) {	if (y < 0) y = 0;	y0 = half_mask_height - y;	h0  = Cursor_mask_height - y0;    }        if (y > displayHeight - half_mask_height) {	if (y > displayHeight) y = displayHeight;	h0 = Cursor_mask_height - (half_mask_height - (displayHeight - y));    }    /* end of coordinate correction */        image = XGetImage(scr->display, scr->rootWin, x + x0 - Cursor_x_hot, 		      y + y0 - Cursor_y_hot, w0, h0, AllPlanes, ZPixmap);        pixmap = XCreatePixmap(scr->display, W_DRAWABLE(scr), Cursor_mask_width, 			   Cursor_mask_height, scr->depth);    XPutImage(scr->display, pixmap, scr->copyGC, image, 0, 0, x0, y0, w0, h0);    XDestroyImage(image);        return pixmap;}