This function is to calculate the offset of pos relative to origin? Then this is a wrong approach.
If the incoming origin is a value before scaling, then the result of (pos-origin)*scaleFactor is an "increment" after scaling, the "increment" after scaling + the origin before scaling will be wrong result. It should be correct that origin also participates in scaling. The calculation formula is (pos-origin) * scaleFactor + origin*scaleFactor. After simplification, it is pos*scaleFactor
If origin is the value when zoomed, then using the pos before zooming-the origin after zooming is also a wrong logic
For the scaling calculation of coordinates, origin is not required
In line 279 of xcbwindow.cpp, this function will be used to calculate the window size, which will cause an error in the display of the application position under dual screens
You can see that the circle drawn from 0,0 is not displayed completely. Although the geometry of the window is 0,0, the rect created in XcbWIndow is -540,0.