Commit 8afc5fe6 authored by Florian Köberle's avatar Florian Köberle Committed by Alexandre Julliard

user32: Fix maximized child windows.

parent 4cfb1e69
......@@ -5190,15 +5190,6 @@ static void test_fullscreen(void)
/* Windows makes a maximized window slightly larger (to hide the borders?) */
fixup = min(abs(rc.left), abs(rc.top));
InflateRect(&rc, -fixup, -fixup);
/* FIXME: this doesn't work correctly in Wine for child windows yet */
if (style & WS_CHILD)
todo_wine
ok(rc.left >= mi.rcWork.left && rc.top <= mi.rcWork.top &&
rc.right <= mi.rcWork.right && rc.bottom <= mi.rcWork.bottom,
"%#x/%#x: window rect %d,%d-%d,%d must be in %d,%d-%d,%d\n",
ex_style, style, rc.left, rc.top, rc.right, rc.bottom,
mi.rcWork.left, mi.rcWork.top, mi.rcWork.right, mi.rcWork.bottom);
else
ok(rc.left >= mi.rcWork.left && rc.top <= mi.rcWork.top &&
rc.right <= mi.rcWork.right && rc.bottom <= mi.rcWork.bottom,
"%#x/%#x: window rect %d,%d-%d,%d must be in %d,%d-%d,%d\n",
......
......@@ -658,6 +658,7 @@ void WINPOS_GetMinMaxInfo( HWND hwnd, POINT *maxSize, POINT *maxPos,
HMONITOR monitor;
INT xinc, yinc;
LONG style = GetWindowLongW( hwnd, GWL_STYLE );
LONG adjustedStyle;
LONG exstyle = GetWindowLongW( hwnd, GWL_EXSTYLE );
RECT rc;
WND *win;
......@@ -671,10 +672,12 @@ void WINPOS_GetMinMaxInfo( HWND hwnd, POINT *maxSize, POINT *maxPos,
if (style & WS_CHILD)
{
if ((style & WS_CAPTION) == WS_CAPTION)
style &= ~WS_BORDER; /* WS_CAPTION = WS_DLGFRAME | WS_BORDER */
adjustedStyle = style & ~WS_BORDER; /* WS_CAPTION = WS_DLGFRAME | WS_BORDER */
else
adjustedStyle = style;
GetClientRect(GetAncestor(hwnd,GA_PARENT), &rc);
AdjustWindowRectEx(&rc, style, ((style & WS_POPUP) && GetMenu(hwnd)), exstyle);
AdjustWindowRectEx(&rc, adjustedStyle, ((style & WS_POPUP) && GetMenu(hwnd)), exstyle);
MinMax.ptMaxSize.x = rc.right - rc.left;
MinMax.ptMaxSize.y = rc.bottom - rc.top;
......
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