Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

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

Closed
charles-roberts opened this issue Apr 16, 2020 · 2 comments

Comments

@charles-roberts
Copy link

charles-roberts commented Apr 16, 2020

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 added a commit that referenced this issue Apr 18, 2020
Restoring floating window position on multiple monitors uses wrong Point for Virtual Screen location
@Dirkster99
Copy link
Owner

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

Thanx Drk

@charles-roberts
Copy link
Author

You're welcome. Glad to help.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants