-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Open
Labels
B - bugDang, that shouldn't have happenedDang, that shouldn't have happenedS - apiDesign and usabilityDesign and usability
Milestone
Description
Window::outer_position, MonitorHandle::position and WindowEvent::Moved is fundamentally broken on macOS.
Desktop/window coordinates are internally closer to a LogicalPosition, but since the return type of these is PhysicalPosition, we convert the position using the monitor's scale factor, which is incorrect since it assumes that all monitors have that scale factor.
To illustrate the issue, imagine three monitors configured to be next to each other like this:
[ ] [ ] [ ]
[ 1 ] [ 2 ] [ 3 ]
[ logical=1920x1080 ] [ logical=1280x800 ] [ logical=2560x1440 ]
[ scale_factor=2 ] [ scale_factor=1 ] [ scale_factor=1 ]
[ ] [ ] [ ]
The output of monitor.position().x (that is, the x desktop/window-coordinate) would then be:
| Desired physical | Desired logical | macOS API | Other platforms | |
|---|---|---|---|---|
| Monitor 1 | 0 |
0 |
0 |
0 |
| Monitor 2 | 1920 * 2 |
1920 |
1920 |
1920 * 2 maybe? |
| Monitor 3 | 1920 * 2 + 1280 |
1920 + 1280 |
1920 + 1280 |
1920 * 2 + 1280 maybe? |
1111mp
Metadata
Metadata
Assignees
Labels
B - bugDang, that shouldn't have happenedDang, that shouldn't have happenedS - apiDesign and usabilityDesign and usability