Dirkster99 / AvalonDock

Our own development branch of the well known WPF document docking library

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Restoring floating window position on multiple monitors uses wrong Point for Virtual Screen location

charles-roberts opened this issue · comments

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, ...

Hi, thanx for the good issue description and fix. I was able to verify and fix as suggested.

Thanx Drk

You're welcome. Glad to help.