Commit 00bf3811 authored by Sylvain St-Germain's avatar Sylvain St-Germain Committed by Alexandre Julliard

Fixed inconsistency in conditions that determines if a window requires

a WM border.
parent 28896ee7
......@@ -226,4 +226,8 @@ extern LRESULT WINAPI EditWndProc( HWND hwnd, UINT msg, WPARAM wParam, LPARAM lP
extern LRESULT WINAPI ListBoxWndProc( HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam );
extern LRESULT WINAPI ComboLBWndProc( HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam );
/* generic method that returns TRUE if the window properties ask for a
window manager type of border */
extern BOOL WIN_WindowNeedsWMBorder( DWORD style, DWORD exStyle );
#endif /* __WINE_WIN_H */
......@@ -75,6 +75,21 @@ static HBITMAP16 hbitmapRestoreD = 0;
(((hit) == HTBOTTOM) || ((hit) == HTBOTTOMLEFT) || ((hit) == HTBOTTOMRIGHT))
/***********************************************************************
* WIN_WindowNeedsWMBorder
*
* This method defines the rules for a window to have a WM border,
* caption... It is used for consitency purposes.
*/
BOOL WIN_WindowNeedsWMBorder( DWORD style, DWORD exStyle )
{
if (!(style & WS_CHILD) && Options.managed &&
(((style & WS_CAPTION) == WS_CAPTION) ||
(style & WS_THICKFRAME) ||
(exStyle & WS_EX_DLGMODALFRAME))) return TRUE;
return FALSE;
}
/***********************************************************************
* NC_AdjustRect
*
* Compute the size of the window rectangle from the size of the
......@@ -88,9 +103,7 @@ static void NC_AdjustRect( LPRECT16 rect, DWORD style, BOOL menu,
if(style & WS_ICONIC) return;
/* Decide if the window will be managed (see CreateWindowEx) */
if (!(Options.managed && !(style & WS_CHILD) &&
((style & (WS_DLGFRAME | WS_THICKFRAME)) ||
(exStyle & WS_EX_DLGMODALFRAME))))
if (!WIN_WindowNeedsWMBorder(style, exStyle))
{
if (HAS_THICKFRAME( style, exStyle ))
InflateRect16( rect, GetSystemMetrics(SM_CXFRAME), GetSystemMetrics(SM_CYFRAME) );
......@@ -156,9 +169,7 @@ NC_AdjustRectOuter95 (LPRECT16 rect, DWORD style, BOOL menu, DWORD exStyle)
if(style & WS_ICONIC) return;
/* Decide if the window will be managed (see CreateWindowEx) */
if (!(Options.managed && !(style & WS_CHILD) &&
((style & (WS_DLGFRAME | WS_THICKFRAME)) ||
(exStyle & WS_EX_DLGMODALFRAME))))
if (!WIN_WindowNeedsWMBorder(style, exStyle))
{
if (HAS_THICKFRAME( style, exStyle ))
InflateRect16( rect, GetSystemMetrics(SM_CXFRAME), GetSystemMetrics(SM_CYFRAME) );
......
......@@ -188,9 +188,7 @@ BOOL X11DRV_WND_CreateWindow(WND *wndPtr, CLASS *classPtr, CREATESTRUCTA *cs, BO
/* Create "managed" windows only if a title bar or resizable */
/* frame is required. */
if (Options.managed && ( ((cs->style & WS_CAPTION) == WS_CAPTION) ||
(cs->style & WS_THICKFRAME) ||
(cs->dwExStyle & WS_EX_DLGMODALFRAME)))
if (WIN_WindowNeedsWMBorder(cs->style, cs->dwExStyle))
{
win_attr.event_mask = ExposureMask | KeyPressMask |
KeyReleaseMask | PointerMotionMask |
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment