Bug with resolution when scaling with xrandr

Hello, I’m using xrandr to scale everything without other dpi tools and it works like a charm in most of the apps. Except SDL ones.
xrandr --output eDP-1 --scale 0.5x0.5 --filter nearest
resolutions: (ah, new users can’t upload files, ok) https://dpaste.com/2NRFCGPH9
Screen 0: minimum 320 x 200, current 1440 x 960, maximum 32767 x 32767
eDP-1 connected primary 1440x960+0+0 (normal left inverted right x axis y axis) 266mm x 177mm
Using SDL_GetCurrentDisplayMode, SDL_GetWindowPosition and SDL_WINDOWPOS_CENTERED.
I found out that the resolution which SDL uses is wrong, it gets:
window x: 1439, window y: 959, display w: 2880, display h: 1920,
expected:
window x: 719, window y: 479, display w: 1440, display h: 960,
I’ll cite SO “On high-DPI displays this will return the virtual resolution, not the physical resolution.” this is wrong, as virtual resolution is 1440x960.
So, SDL somehow misses the xrandr scaling/resolution.
minimal app to reproduce:
https://dpaste.com/GXGFLM6LL
This bug messes with many games which are using SDL.