You need to get relative cursor position compared to where it was last frame. You then take that offset and apply it to the new position for the window.
Here, you're just setting the window position to where it was previously. (Do the math in your head)