From 48c6eb55f7ebf59c00260678eda22e2069d2c3d8 Mon Sep 17 00:00:00 2001 From: Abey George Date: Fri, 3 Sep 1999 12:33:40 +0000 Subject: [PATCH] Fixed resizing bugs for windows with WS_THICKFRAME and WS_DLGFRAME styles. --- windows/nonclient.c | 2 +- windows/win.c | 1 - windows/x11drv/wnd.c | 8 ++++++-- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/windows/nonclient.c b/windows/nonclient.c index beb10f80625..60428f66a05 100644 --- a/windows/nonclient.c +++ b/windows/nonclient.c @@ -63,7 +63,7 @@ BYTE lpGrayMask[] = { 0xAA, 0xA0, #define HAS_THICKFRAME(style,exStyle) \ (((style) & WS_THICKFRAME) && \ - !((exStyle) & WS_EX_DLGMODALFRAME)) + !(((style) & (WS_DLGFRAME|WS_BORDER)) == WS_DLGFRAME)) #define HAS_THINFRAME(style) \ (((style) & WS_BORDER) || !((style) & (WS_CHILD | WS_POPUP))) diff --git a/windows/win.c b/windows/win.c index 2b2edf8585f..3e41d79e892 100644 --- a/windows/win.c +++ b/windows/win.c @@ -862,7 +862,6 @@ static HWND WIN_CreateWindowEx( CREATESTRUCTA *cs, ATOM classAtom, wndPtr->flags |= WIN_NEED_SIZE; } } - if (cs->dwExStyle & WS_EX_DLGMODALFRAME) wndPtr->dwStyle &= ~WS_THICKFRAME; /* Get class or window DC if needed */ diff --git a/windows/x11drv/wnd.c b/windows/x11drv/wnd.c index 541936bf6b8..29a88db2b2f 100644 --- a/windows/x11drv/wnd.c +++ b/windows/x11drv/wnd.c @@ -32,6 +32,10 @@ DEFAULT_DEBUG_CHANNEL(win) + /* Some useful macros */ +#define HAS_DLGFRAME(style,exStyle) \ +((!((style) & WS_THICKFRAME)) && (((style) & WS_DLGFRAME) || ((exStyle) & WS_EX_DLGMODALFRAME))) + /**********************************************************************/ extern Cursor X11DRV_MOUSE_XCursor; /* Current X cursor */ @@ -247,7 +251,7 @@ BOOL X11DRV_WND_CreateWindow(WND *wndPtr, CLASS *classPtr, CREATESTRUCTA *cs, BO size_hints->win_gravity = StaticGravity; size_hints->flags = PWinGravity; - if (cs->dwExStyle & WS_EX_DLGMODALFRAME) + if (HAS_DLGFRAME(cs->style,cs->dwExStyle)) { size_hints->min_width = size_hints->max_width = cs->cx; size_hints->min_height = size_hints->max_height = cs->cy; @@ -510,7 +514,7 @@ void X11DRV_WND_SetWindowPos(WND *wndPtr, const WINDOWPOS *winpos, BOOL bChangeP /* Tweak dialog window size hints */ if ((winposPtr->flags & WIN_MANAGED) && - (winposPtr->dwExStyle & WS_EX_DLGMODALFRAME)) + HAS_DLGFRAME(winposPtr->dwStyle,winposPtr->dwExStyle)) { XSizeHints *size_hints = TSXAllocSizeHints();