in case of you, use PixelPosition instead of ViewportPosition. as you saw, the ViewportPosition indicates the position in your monitor. it means, ViewportPosition can differ depending on where the game window is located. the other hand, PixelPosition indicates the position in the game window.