[macOS] outer_position
and set_outer_position
may work unexpectedly with multiple monitors in different DPI
#816
Labels
Describe the bug
outer_position
, tao will get the window's coordination (LogicalPosition
) and then multiply it by the monitor'sscale_factor
which the window currently displays to aPhysicalPosition
.set_outer_position
, thescale_factor
is also obtained from the monitor that the window currently displays.outer_position
from a monitor andset_outer_position
from another monitor, thePhysicalPostiion
andLogicalPosition
conversions may use differentscale_factor
, and theLogicalPosition
obtained from and given to macOS may be different after conversion.Let's have an example:
We have 2 monitors:
and a window sit in M1 with
LogicalPosition(80, 20)
outer_position
, they gotPhysicalPosition(160, 40)
set_outer_position(PhysicalPosition(160, 40))
when the window is inM1
, tao converts it toLogicalPosition(80, 20)
.set_outer_position(PhysicalPosition(160, 40))
when the window is inM2
, tao converts it toLogicalPosition(160, 40)
, sinceM2
'sscale_factor
is 1.0. The window will be moved toM2
because the coordination sits within M2's bounds.Steps To Reproduce
Refer to the example above.
Expected behavior
To set the window position as expected.
Platform and Versions (please complete the following information):
OS: macOS 14.0
Would you want to assign yourself to resolve this bug?
Additional context
Related issue:
MonitorHandle::position
andMonitorHandle::size
metrics are unclear rust-windowing/winit#2645The text was updated successfully, but these errors were encountered: