rem: int			x, y;
context: magnifyPutCursor(WMWidget *w, void *data){    W_ColorPanel	*panel = (W_ColorPanel*)(data);    W_Screen		*scr = WMWidgetScreen(panel->win);    Cursor		magCursor;    int			x, y;    Pixmap		pixmap;    XEvent		event;    WMPoint		initialPosition;        /* Destroy wheelBackImg, so it'll update properly */    if (panel->selectionBackImg) {	XFreePixmap(WMWidgetScreen(panel->win)->display, 		    panel->selectionBackImg);	panel->selectionBackImg = None;    }        /* Create magnifying glass */    panel->magnifyGlass = wmalloc(sizeof(MovingView));    panel->magnifyGlass->view = magnifyCreateView(panel);    if (!panel->magnifyGlass->view)	return;    initialPosition = magnifyInitialize(panel);    x = initialPosition.x;    y = initialPosition.y;       W_MoveView(panel->magnifyGlass->view, 	       x - Cursor_x_hot, 	       y - Cursor_y_hot);    W_MapView(panel->magnifyGlass->view);        magCursor = magnifyGrabPointer(panel);        while (panel->magnifyGlass->image)     {	WMNextEvent(scr->display, &event);	/* Pack motion events */        while (XCheckTypedEvent(scr->display, MotionNotify, &event)) {        }		switch (event.type)	{	 case ButtonPress:	    XDestroyImage(panel->magnifyGlass->image);	    panel->magnifyGlass->image = NULL;	    	    if (event.xbutton.button == Button1) {		updateSwatch(panel, panel->magnifyGlass->color);	    }	    switch (panel->mode) {	     case WMWheelModeColorPanel:		wheelInit(panel);		wheelRender(panel);		wheelPaint(panel);		break;	     case WMGrayModeColorPanel:		grayInit(panel);		break;	     case WMRGBModeColorPanel:		rgbInit(panel);		break;	     case WMCMYKModeColorPanel:		cmykInit(panel);		break;	     case WMHSBModeColorPanel:		hsbInit(panel);		break;	     default:		break;	    }	    panel->lastChanged = panel->mode; 	    	    WMSetButtonSelected(panel->magnifyBtn, False);	    break;	    	 case MotionNotify:	    /* Get a "dirty rectangle" */	    magnifyGetImageStored( panel, x, y,		    event.xmotion.x_root, event.xmotion.y_root);	    	    /* Update coordinates */	    x = event.xmotion.x_root;	    y = event.xmotion.y_root;	    	    /* Move view */	    W_MoveView(panel->magnifyGlass->view, x - Cursor_x_hot, 		       y - Cursor_y_hot);	    	    /* Put new image (with magn.) in view */	    pixmap = magnifyCreatePixmap(panel);	    if (pixmap != None) {		XSetWindowBackgroundPixmap(scr->display,			panel->magnifyGlass->view->window, pixmap);		XClearWindow(scr->display, panel->magnifyGlass->view->window);				XFreePixmap(scr->display, pixmap);	    }	    break;	/* Try XQueryPointer for this !!! It returns windows that the pointer	 * is over. Note: We found this solving the invisible donkey cap bug	 */#if 0	/* As it is impossible to make this work in all cases,	 * we consider it confusing. Therefore we disabled it.	 */	 case FocusOut:		/* fall through */	 case FocusIn:	    /*	     * Color Panel window (panel->win) lost or received focus.	     * We need to update the pixmap in the magnifying glass.	     *	     * BUG Doesn't work with focus switches between two windows	     * if none of them is the color panel.	     */	    XUngrabPointer(scr->display, CurrentTime);	    W_UnmapView(panel->magnifyGlass->view);	    	    magnifyInitialize(panel);	    	    W_MapView(panel->magnifyGlass->view);	    XGrabPointer (scr->display, panel->magnifyGlass->view->window, 		    True, PointerMotionMask | ButtonPressMask,		    GrabModeAsync, GrabModeAsync,		    scr->rootWin, magCursor, CurrentTime);	    break;#endif	    	 default:	    WMHandleEvent(&event);	    break;	} /* of switch */    }        XUngrabPointer(scr->display, CurrentTime);    XFreeCursor(scr->display, magCursor);        XFreePixmap(scr->display, panel->magnifyGlass->magPix);    panel->magnifyGlass->magPix = None;    W_UnmapView(panel->magnifyGlass->view);    W_DestroyView(panel->magnifyGlass->view);    panel->magnifyGlass->view = NULL;        wfree(panel->magnifyGlass);}