[PATCH] winex11.drv: Handle WM_GETMINMAXINFO while resizing resizable window.

Jactry Zeng jzeng at codeweavers.com
Tue Apr 28 09:50:54 CDT 2020


This patch only sets minimum tracking width/height when both ptMinTrackSize.x
and ptMinTrackSize.y are non-zero value. And it didn't handle ptMaxTrackSize's
case.
Windows has a more complex behaviour which allows application to set
minimum/maximum tracking width or height individually, but this patch already
made some applications happy.

Signed-off-by: Jactry Zeng <jzeng at codeweavers.com>
---
 dlls/winex11.drv/window.c | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/dlls/winex11.drv/window.c b/dlls/winex11.drv/window.c
index 52e345ceb6..3c3e4bc9a5 100644
--- a/dlls/winex11.drv/window.c
+++ b/dlls/winex11.drv/window.c
@@ -694,6 +694,19 @@ static void set_size_hints( struct x11drv_win_data *data, DWORD style )
             size_hints->min_height = size_hints->max_height;
             size_hints->flags |= PMinSize | PMaxSize;
         }
+        else
+        {
+            MINMAXINFO minmax;
+
+            memset( &minmax, 0, sizeof(minmax) );
+            SendMessageW( data->hwnd, WM_GETMINMAXINFO, 0, (LPARAM)&minmax );
+            if (minmax.ptMinTrackSize.x && minmax.ptMinTrackSize.y)
+            {
+                size_hints->min_width = minmax.ptMinTrackSize.x;
+                size_hints->min_height = minmax.ptMinTrackSize.y;
+                size_hints->flags |= PMinSize;
+            }
+        }
     }
     XSetWMNormalHints( data->display, data->whole_window, size_hints );
     XFree( size_hints );
-- 
2.26.2



More information about the wine-devel mailing list