From 4e681585ff84df59a969a2573239747745ceb688 Mon Sep 17 00:00:00 2001 From: Unknown Date: Wed, 2 Aug 2017 18:35:10 +0100 Subject: [PATCH] Fix max size on non-primary monitor with larger width --- Source/Fasetto.Word/Window/WindowResizer.cs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/Source/Fasetto.Word/Window/WindowResizer.cs b/Source/Fasetto.Word/Window/WindowResizer.cs index c5a3807..b5e178c 100644 --- a/Source/Fasetto.Word/Window/WindowResizer.cs +++ b/Source/Fasetto.Word/Window/WindowResizer.cs @@ -333,11 +333,21 @@ private void WmGetMinMaxInfo(System.IntPtr hwnd, System.IntPtr lParam) // - Position lMmi.PointMaxPosition.X = currentX; lMmi.PointMaxPosition.Y = currentY; + // // - Size lMmi.PointMaxSize.X = currentWidth; lMmi.PointMaxSize.Y = currentHeight; + // NOTE: This fixes the bug mentioned below... setting the max size to the size of the current window + // which I think is a reasonable limit for the window + // + // In future we should find a good way to detect the size request coming from a window about to + // maximize and limit this constraint to only when maximized. For now this is fine + // + lMmi.PointMaxTrackSize.X = currentWidth; + lMmi.PointMaxTrackSize.Y = currentHeight; + // // BUG: // NOTE: I've noticed a bug which I think is Windows itself