It seems that the cursor position gets wrong when moving the window from a lowdpi screen to a highdpi screen (or vice versa). Probably some issue related to device pixel ratio change?