Skip to content

Commit

Permalink
Fixing #150
Browse files Browse the repository at this point in the history
Restoring floating window position on multiple monitors uses wrong Point for Virtual Screen location
  • Loading branch information
Dirkster99 committed Apr 18, 2020
1 parent 96262c4 commit fa6b62c
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,8 @@ internal static void KeepInsideNearestMonitor(this ILayoutElementForFloatingWind
if (SystemParameters.PrimaryScreenWidth == SystemParameters.VirtualScreenWidth &&
SystemParameters.PrimaryScreenHeight == SystemParameters.VirtualScreenHeight)
{
RECT primaryscreen = new RECT(0, 0, (int)SystemParameters.PrimaryScreenWidth, (int)SystemParameters.PrimaryScreenHeight);
RECT primaryscreen = new RECT((int)SystemParameters.VirtualScreenLeft, (int)SystemParameters.VirtualScreenTop,
(int)SystemParameters.PrimaryScreenWidth, (int)SystemParameters.PrimaryScreenHeight);

if (!RectanglesIntersect(normalPosition, primaryscreen))
{
Expand All @@ -60,7 +61,8 @@ internal static void KeepInsideNearestMonitor(this ILayoutElementForFloatingWind
}
else
{
RECT primaryscreen = new RECT(0, 0, (int)SystemParameters.VirtualScreenWidth, (int)SystemParameters.VirtualScreenHeight);
RECT primaryscreen = new RECT((int)SystemParameters.VirtualScreenLeft, (int)SystemParameters.VirtualScreenTop,
(int)SystemParameters.VirtualScreenWidth, (int)SystemParameters.VirtualScreenHeight);

if (!RectanglesIntersect(normalPosition, primaryscreen))
{
Expand Down

0 comments on commit fa6b62c

Please # to comment.