Page MenuHome

Child Windows Positioning Problems with Multiple Monitors (Win32)
Closed, ResolvedPublicBUG


System Information
Operating system: Windows-10-10.0.19041-SP0 64 Bits
Graphics card: GeForce GTX 745/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 398.11

Blender Version
Broken: version: 2.93.0 Alpha, branch: Unknown, commit date: Unknown Unknown, hash: rBUnknown
Worked: never

Short description of error
On Windows, child windows are incorrectly positioned when using multiple monitors

Exact steps for others to reproduce the error

The "Properties" window is meant to be opened centered around where the mouse is positioned at that time. Because the window sizes and locations are sanity-checked, it is best to make your Blender window fairly small and positioned near the center. Then open Preferences from the Edit menu

I have three monitors, all the same size, arranged horizontally. The middle one is the "main" monitor. The following shows the results when done on each of my monitors, on older versions of Blender, in this case 2.91:

The middle monitor (top), works perfectly with Preferences positioned as desired. When done on my left-most monitor (shown bottom-left), Preferences is instead shown at the left edge of my middle monitor. My right-most monitor (shown bottom-right) opens Preferences at the right edge of my middle monitor.

Master, 2.93, is better, but not perfect:

On each monitor Preferences opens on the same monitor as the parent window. Unfortunately the positioning within that monitor is incorrect. The middle monitor again, is perfect but the left monitor shows it too far right, and the right monitor shows it too far left.

The cause of this is because we are checking the new location to see if fits using wm_window_check_position() and that logic is a bit flawed because it does not take into account the monitor origins, only the sizes. my left-most monitor has a horizontal axis that runs from -1919 to -1, the middle one from 0-1919, and the third from 1920 to 3840. But when this function is called to see if a window fits on the current monitor it only compares the numbers against 1920 and 1280.