Wouldn't it be much simpler to call into win32u where you can simply check virtual vs physical source geometry?
I am not sure I understand how would you like to do this. The problem is that the virtual desktop window, from the perspective win32u, always has (0, 0) as its left top corner. So we need to compare the X11 desktop window geometry in the X11 virtual screen space. If we want convert the X11 desktop window geometry to win32 virtual screen coordinates and do the comparison in win32u, we can't use root_to_virtual_screen() and so we still have to query X11 virtual screen for the X11 to win32 screen offset.