diff --git a/source/Components/AvalonDock/Layout/ILayoutElementForFloatingWindowExtension.cs b/source/Components/AvalonDock/Layout/ILayoutElementForFloatingWindowExtension.cs index 2f31f091..a3bde675 100644 --- a/source/Components/AvalonDock/Layout/ILayoutElementForFloatingWindowExtension.cs +++ b/source/Components/AvalonDock/Layout/ILayoutElementForFloatingWindowExtension.cs @@ -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)) { @@ -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)) {