Restoring floating window position on multiple monitors uses wrong Point for Virtual Screen location
charles-roberts opened this issue · 2 comments
charles-roberts commented
The check in ILayoutElementForFloatingWindowExtension.KeepInsideNearestMonitor is using 0,0 for the upper left of the Virtual Screen. The result is that floating windows on a monitor to the left or top of a main monitor will be restored onto the main monitor when the layout is deserialized. I think an easy fix is to change:
In /Components/Xceed.Wpf.AvalonDock.Layout/ILayoutElementForFloatingWindowExtension.cs
RECT primaryscreen = new RECT(0, 0, ...
to
RECT primaryscreen = new RECT((int)SystemParameters.VirtualScreenLeft, (int)SystemParameters.VirtualScreenTop, ...
Dirkster99 commented
Hi, thanx for the good issue description and fix. I was able to verify and fix as suggested.
Thanx Drk
charles-roberts commented
You're welcome. Glad to help.