From: "Chao Long" Subject: [PATCH] winex11.drv: Make the size of the window (with WS_THICKFRAME style) not over the minimum range when dragging. Message-Id: <202009071503287253550@uniontech.com> Date: Mon, 7 Sep 2020 15:03:29 +0800 From e9e00a449b71b7f43c31938457cb631f9193cafb Mon Sep 17 00:00:00 2001 From: Chao Long Date: Mon, 7 Sep 2020 14:51:18 +0800 Subject: [PATCH] winex11.drv: Make the size of the window (with WS_THICKFRAME style) not over the minimum range when dragging. Signed-off-by: Chao Long --- dlls/winex11.drv/window.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/dlls/winex11.drv/window.c b/dlls/winex11.drv/window.c index 455957264b..573db586a5 100644 --- a/dlls/winex11.drv/window.c +++ b/dlls/winex11.drv/window.c @@ -721,6 +721,24 @@ 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; } + /*with WS_THICKFRAME style*/ + else if ( style & WS_THICKFRAME) + { + /*SendMessageW WM_GETMINMAXINFO in work threads can cause deadlocks*/ + if (GetWindowThreadProcessId( data->hwnd, NULL ) == GetCurrentThreadId()) + { + MINMAXINFO info; + info.ptMinTrackSize.x = 0; + info.ptMinTrackSize.y = 0; + SendMessageW(data->hwnd, WM_GETMINMAXINFO, 0, (LPARAM)&info); + if (info.ptMinTrackSize.x!=0 && info.ptMinTrackSize.y!=0) + { + size_hints->min_width = info.ptMinTrackSize.x; + size_hints->min_height = info.ptMinTrackSize.y; + size_hints->flags |= PMinSize; + } + } + } } XSetWMNormalHints( data->display, data->whole_window, size_hints ); XFree( size_hints ); -- 2.20.1