Page MenuHome

Fix T86185: Win32 Multiple Monitor Window Position
ClosedPublic

Authored by Harley Acheson (harley) on Mar 3 2021, 12:17 AM.

Details

Summary

This is yet another very simple code removal from GHOST_WindowWin32.cpp. Why?

Until D10469 blender window creation included code that clamped window locations to within the dimensions of the monitor. But a monitor to the left of your main one will have negative values while those to the right of your main monitor will have bounds that are all greater than the width the monitor it is on. So we might have wanted to place a window at position -1000, 200 but that would get clamped to 0,200.

With the above in place, all new windows would have been always created on the main monitor. So there has always been some code to force children to be on, or relative to, their parents. But with the above fixed that is not longer needed nor desired. So this just removes all uses of the window's parent's bounds as they are never needed.

With this patch applied, you can have one instance of Blender with windows all all over your separate monitors, save the blend file, then reopen and have all the windows restored to where they were. And when when any of those windows open their own children they are (of course) placed correctly.

Diff Detail

Repository
rB Blender

Event Timeline

Harley Acheson (harley) requested review of this revision.Mar 3 2021, 12:17 AM
Harley Acheson (harley) created this revision.

Whoops, didn't mean to imply that this fix corrects all related issues. Although (so far) unreported, we probably still have some issues with positioning child windows when monitors are arranged vertically, but that is caused by something unrelated and not in ghost code. Hopefully I can get to testing/fixing that soon.

Thanks for the patch, I checked it and it solved T85867 as well :)

I'm on a single monitor system, any chance you can attach a multi screen .blend so i can test that still opens correctly?

Yes, the following blend opens three windows, the main one plus two children. The children are not full-size.

It is saved on a system that has three monitors arranged horizontally with the middle monitor set as main. For anyone with identical arrangement the main window will open in the middle, and there will be children on each of the two other monitors.

On systems that are not identical the result is necessarily different. Three monitors with leftmost as main should open two windows on the left (the main plus one child) with a third in the middle.

With a single monitor all three should be all on the main monitor.

Still works fine on single monitor, and @Erick Tukuniata (erickblender) gave it a whirl on dual screens, lgtm!

This revision is now accepted and ready to land.Mar 5 2021, 2:27 AM