rem: doWindowMove(wwin, event.xmotion.x_root + XOffset, event.xmotion.y_root + YOffset, scr->selected_windows, ox - orig_x, oy - orig_y, off_x, off_y);
add: doWindowMove(wwin, scr->selected_windows, moveData.realX - wwin->frame_x, moveData.realY - wwin->frame_y);
context: wMouseMoveWindow(WWindow *wwin, XEvent *ev){    WScreen *scr = wwin->screen_ptr;    XEvent event;    Window root = scr->root_win;    KeyCode shiftl, shiftr;    int w = wwin->frame->core->width;    int h = wwin->frame->core->height;    int x = wwin->frame_x;    int y = wwin->frame_y;    int ox, oy, orig_x, orig_y;    int off_x, off_y;    short count = 0;		/* for automatic workspace creation */    int started = 0;    int warped = 0;    /* This needs not to change while moving, else bad things can happen */    int opaque_move = wPreferences.opaque_move;    int XOffset, YOffset, origDragX, origDragY;        origDragX = wwin->frame_x;    origDragY = wwin->frame_y;    XOffset = origDragX - ev->xbutton.x_root;    YOffset = origDragY - ev->xbutton.y_root;        if (!wwin->flags.selected) {	/* this window is not selected, unselect others and move only wwin */	wUnselectWindows(scr);    }    orig_x = ox = ev->xbutton.x_root;    orig_y = oy = ev->xbutton.y_root;    off_x = x; off_y = y;    checkEdgeResistance(wwin, &off_x, &off_y, 0, 0);    off_x = (off_x-x); off_y = (off_y-y);#ifdef DEBUG    puts("Moving window");#endif    shiftl = XKeysymToKeycode(dpy, XK_Shift_L);    shiftr = XKeysymToKeycode(dpy, XK_Shift_R);    while (1) {	if (warped) {            int junk;            Window junkw;	    	    /* XWarpPointer() doesn't seem to generate Motion events, so	     we've got to simulate them */            printf("warp\n");	    XQueryPointer(dpy, root, &junkw, &junkw, &event.xmotion.x_root,			  &event.xmotion.y_root, &junk, &junk,			  (unsigned *) &junk);	} else {	    Window win;	    	    WMMaskEvent(dpy, KeyPressMask | ButtonMotionMask			| ButtonReleaseMask | ButtonPressMask | ExposureMask, &event);	    	    if (event.type == MotionNotify) {		/* compress MotionNotify events */		win = event.xmotion.window;		while (XCheckMaskEvent(dpy, ButtonMotionMask, &event)) ;	    }	}	switch (event.type) {	 case KeyPress:	    if (scr->selected_windows)		break;	    if ((event.xkey.keycode == shiftl || event.xkey.keycode == shiftr)		&& started) {		if (!opaque_move)                    drawFrames(wwin, scr->selected_windows,                               ox - orig_x, oy - orig_y, off_x, off_y);				cyclePositionDisplay(wwin, x, y, w, h);				if (!opaque_move) {		    drawFrames(wwin, scr->selected_windows,			       ox - orig_x, oy - orig_y, off_x, off_y);		} 		showPosition(wwin, x, y);	    }	    break;	    	 case MotionNotify:	    if (started) {		showPosition(wwin, x, y);                if (!opaque_move) {                    drawFrames(wwin, scr->selected_windows,                               ox-orig_x, oy-orig_y, off_x, off_y);                } else {                    doWindowMove(wwin, event.xmotion.x_root + XOffset,                                 event.xmotion.y_root + YOffset,                                 scr->selected_windows,                                 event.xmotion.x_root - ox,                                 event.xmotion.y_root - oy,                                 off_x, off_y);                }                x = event.xmotion.x_root + XOffset;                y = event.xmotion.y_root + YOffset;                checkEdgeResistance(wwin, &x, &y, off_x, off_y);		if (!scr->selected_windows) {		    if (wPreferences.move_display == WDIS_FRAME_CENTER)			moveGeometryDisplayCentered(scr, x + w/2, y + h/2);		}		if (!warped && !wPreferences.no_autowrap) {		    if (event.xmotion.x_root <= 1) {			if (scr->current_workspace > 0) {			    crossWorkspace(scr, wwin, opaque_move, 					   scr->current_workspace-1, True);			    warped = 1;			    count = 0;			} else if (scr->current_workspace == 0				   && wPreferences.ws_cycle) {			    crossWorkspace(scr, wwin, opaque_move, 					   scr->workspace_count-1, True);			    warped = 1;			    count = 0;			    			}		    } else if (event.xmotion.x_root >= scr->scr_width - 2) {			if (scr->current_workspace == scr->workspace_count-1) {			    if ((!wPreferences.ws_advance && wPreferences.ws_cycle)				|| (scr->workspace_count == MAX_WORKSPACES)) {				crossWorkspace(scr, wwin, opaque_move, 0, False);				warped = 1;				count = 0;			    }			    /* if user insists on trying to go to next			     workspace even when it's already the last,			     create a new one */			    else if ((ox == event.xmotion.x_root)				     && wPreferences.ws_advance) {								/* detect user "rubbing" the window				 against the edge */				if (count > 0				    && oy - event.xmotion.y_root > MOVE_THRESHOLD)				    count = -(count + 1);				else if (count <= 0					 && event.xmotion.y_root - oy > MOVE_THRESHOLD)				    count = -count + 1;			    }			    /* create a new workspace */			    if (abs(count) > 2) {				/* go to next workspace */				wWorkspaceNew(scr);								crossWorkspace(scr, wwin, opaque_move, 					       scr->current_workspace+1, False);				warped = 1;				count = 0;			    }			} else if (scr->current_workspace < scr->workspace_count) {			    			    /* go to next workspace */			    crossWorkspace(scr, wwin, opaque_move, 					   scr->current_workspace+1, False);			    warped = 1;			    count = 0;			}		    } else {			count = 0;		    }		} else {		    warped = 0;		}	    } else if (abs(orig_x - event.xmotion.x_root) >= MOVE_THRESHOLD		       || abs(orig_y - event.xmotion.y_root) >= MOVE_THRESHOLD) {		XChangeActivePointerGrab(dpy, ButtonMotionMask					 | ButtonReleaseMask | ButtonPressMask,					 wCursor[WCUR_MOVE], CurrentTime);		started = 1;		XGrabKeyboard(dpy, root, False, GrabModeAsync, GrabModeAsync, 			      CurrentTime);		event.xmotion.x_root = orig_x;		event.xmotion.y_root = orig_y;				if (!scr->selected_windows)		    mapPositionDisplay(wwin, x, y, w, h);				if (!opaque_move)		    XGrabServer(dpy);	    }	    ox = event.xmotion.x_root;	    oy = event.xmotion.y_root;	    	    if (started && !opaque_move)		drawFrames(wwin, scr->selected_windows, ox - orig_x, oy - orig_y, off_x, off_y);	    	    showPosition(wwin, x, y);	    break;	 case ButtonPress:	    break;	    	 case ButtonRelease:	    if (event.xbutton.button != ev->xbutton.button)		break;	    if (started) {		if (!opaque_move) {		    drawFrames(wwin, scr->selected_windows,			       ox - orig_x, oy - orig_y, off_x, off_y);		    XSync(dpy, 0);		    doWindowMove(wwin, event.xmotion.x_root + XOffset,                                 event.xmotion.y_root + YOffset,                                 scr->selected_windows,				 ox - orig_x, oy - orig_y, 				 off_x, off_y);		}#ifndef CONFIGURE_WINDOW_WHILE_MOVING		wWindowSynthConfigureNotify(wwin);#endif				XUngrabKeyboard(dpy, CurrentTime);		XUngrabServer(dpy);		if (!opaque_move) {		    wWindowChangeWorkspace(wwin, scr->current_workspace);		    wSetFocusTo(scr, wwin);		}		showPosition(wwin, x, y);		if (!scr->selected_windows) {		    /* get rid of the geometry window */		    unmapPositionDisplay(wwin);		}	    }#ifdef DEBUG	    puts("End move window");#endif	    return started;	    	 default:	    if (started && !opaque_move) {		drawFrames(wwin, scr->selected_windows, ox - orig_x, oy - orig_y, off_x, off_y);		XUngrabServer(dpy);		WMHandleEvent(&event);		XSync(dpy, False);		XGrabServer(dpy);		drawFrames(wwin, scr->selected_windows, ox - orig_x, oy - orig_y, off_x, off_y);	    } else {		WMHandleEvent(&event);	    }	    break;	}    }    return 0;}