rem: XGrabPointer(dpy, dragView->window, True, ButtonMotionMask|ButtonReleaseMask|EnterWindowMask,
add: XGrabPointer(dpy, scr->rootWin, True, ButtonMotionMask|ButtonReleaseMask,
context: dragColor(ColorWell *cPtr, XEvent *event, WMPixmap *image){    WMView *dragView;    WMScreen *scr = cPtr->view->screen;    Display *dpy = scr->display;    XColor black = {0, 0,0,0, DoRed|DoGreen|DoBlue};    XColor green = {0x0045b045, 0x4500,0xb000,0x4500, DoRed|DoGreen|DoBlue};    XColor back = {0, 0xffff,0xffff,0xffff, DoRed|DoGreen|DoBlue};    Bool done = False;    WMColorWell *activeWell = NULL;    dragView = W_CreateTopView(scr);    W_ResizeView(dragView, 16, 16);    dragView->attribFlags |= CWOverrideRedirect | CWSaveUnder;    dragView->attribs.event_mask = StructureNotifyMask;    dragView->attribs.override_redirect = True;    dragView->attribs.save_under = True;    W_MoveView(dragView, event->xmotion.x_root-8, event->xmotion.y_root-8);    W_RealizeView(dragView);    W_MapView(dragView);    XSetWindowBackgroundPixmap(dpy, dragView->window, WMGetPixmapXID(image));    XClearWindow(dpy, dragView->window);        XGrabPointer(dpy, dragView->window, True,		 ButtonMotionMask|ButtonReleaseMask|EnterWindowMask,		 GrabModeSync, GrabModeAsync, 		 scr->rootWin, scr->defaultCursor, CurrentTime);    while (!done) {	XEvent ev;	WMView *view;	XAllowEvents(dpy, SyncPointer, CurrentTime);	WMNextEvent(dpy, &ev);	switch (ev.type) {	 case ButtonRelease:	    if (activeWell != NULL) {		WMSetColorWellColor(activeWell, cPtr->color);		WMPostNotificationName(WMColorWellDidChangeNotification,				       activeWell, NULL);	    } else {		slideView(dragView, ev.xbutton.x_root, ev.xbutton.y_root,			  event->xmotion.x_root, event->xmotion.y_root);	    }	    	    done = True;	    break;	 case EnterNotify:	    view = W_GetViewForXWindow(dpy, ev.xcrossing.window);	    if (view && view->self && W_CLASS(view->self) == WC_ColorWell		&& view->self != activeWell && view->self != cPtr) {		activeWell = view->self;		XRecolorCursor(dpy, scr->defaultCursor, &green, &back);	    } else if (view->self!=NULL && view->self != activeWell) {		XRecolorCursor(dpy, scr->defaultCursor, &black, &back);		activeWell = NULL;	    }	    break;	    	 case MotionNotify:	    W_MoveView(dragView, ev.xmotion.x_root-8, ev.xmotion.y_root-8);	    break;	 default:	    WMHandleEvent(&ev);	    break;	}    }    XUngrabPointer(dpy, CurrentTime);    XRecolorCursor(dpy, scr->defaultCursor, &black, &back);    W_DestroyView(dragView);}