Move WS_EX_MDICHILD check back in win32k. Reordered CreateWindowEx menu sets. All based on wine logic. Should SetMenu first or System menu? Tested with FF and AbiWord.

svn path=/trunk/; revision=31065
This commit is contained in:
James Tabor 2007-12-07 22:56:58 +00:00
parent 0102f7431b
commit 30e5bc01a9
2 changed files with 33 additions and 39 deletions

View file

@ -354,13 +354,6 @@ CreateWindowExA(DWORD dwExStyle,
hInstance, hInstance,
lpParam, lpParam,
FALSE); FALSE);
if ((dwStyle & WS_VISIBLE) && (dwExStyle & WS_EX_MDICHILD) && hwnd != (HWND)0)
{
SendMessageW(hWndParent, WM_MDIREFRESHMENU, 0, 0);
SetWindowPos(hwnd, HWND_TOP, 0, 0, 0, 0, SWP_SHOWWINDOW | SWP_NOMOVE | SWP_NOSIZE);
}
return hwnd; return hwnd;
} }
@ -466,13 +459,6 @@ CreateWindowExW(DWORD dwExStyle,
hInstance, hInstance,
lpParam, lpParam,
TRUE); TRUE);
if ((dwStyle & WS_VISIBLE) && (dwExStyle & WS_EX_MDICHILD) && hwnd != (HWND)0)
{
SendMessageW(hWndParent, WM_MDIREFRESHMENU, 0, 0);
SetWindowPos(hwnd, HWND_TOP, 0, 0, 0, 0, SWP_SHOWWINDOW | SWP_NOMOVE | SWP_NOSIZE);
}
return hwnd; return hwnd;
} }

View file

@ -1657,18 +1657,6 @@ AllocErr:
Wnd->Instance = hInstance; Wnd->Instance = hInstance;
Window->hSelf = hWnd; Window->hSelf = hWnd;
if (!hMenu)
hMenu = Wnd->Class->hMenu;
if (0 != (dwStyle & WS_CHILD))
{
Wnd->IDMenu = (UINT) hMenu;
}
else
{
IntSetMenu(Window, hMenu, &MenuChanged);
}
Window->MessageQueue = PsGetCurrentThreadWin32Thread()->MessageQueue; Window->MessageQueue = PsGetCurrentThreadWin32Thread()->MessageQueue;
IntReferenceMessageQueue(Window->MessageQueue); IntReferenceMessageQueue(Window->MessageQueue);
Window->Parent = ParentWindow; Window->Parent = ParentWindow;
@ -1770,8 +1758,7 @@ AllocErr:
} }
/* create system menu */ /* create system menu */
if((dwStyle & WS_SYSMENU) && if((dwStyle & WS_SYSMENU) )//&& (dwStyle & WS_CAPTION) == WS_CAPTION)
(dwStyle & WS_CAPTION) == WS_CAPTION)
{ {
SystemMenu = IntGetSystemMenu(Window, TRUE, TRUE); SystemMenu = IntGetSystemMenu(Window, TRUE, TRUE);
if(SystemMenu) if(SystemMenu)
@ -1781,6 +1768,20 @@ AllocErr:
} }
} }
/* Set the window menu */
if ((dwStyle & (WS_CHILD | WS_POPUP)) != WS_CHILD)
{
if (hMenu)
IntSetMenu(Window, hMenu, &MenuChanged);
else
{
hMenu = Wnd->Class->hMenu;
if (hMenu) IntSetMenu(Window, hMenu, &MenuChanged);
}
}
else
Wnd->IDMenu = (UINT) hMenu;
/* Insert the window into the thread's window list. */ /* Insert the window into the thread's window list. */
InsertTailList (&PsGetCurrentThreadWin32Thread()->WindowListHead, &Window->ThreadListEntry); InsertTailList (&PsGetCurrentThreadWin32Thread()->WindowListHead, &Window->ThreadListEntry);
@ -2051,7 +2052,6 @@ AllocErr:
RETURN((HWND)0); RETURN((HWND)0);
} }
/* Send move and size messages. */ /* Send move and size messages. */
if (!(Window->Flags & WINDOWOBJECT_NEED_SIZE)) if (!(Window->Flags & WINDOWOBJECT_NEED_SIZE))
{ {
@ -2065,7 +2065,6 @@ AllocErr:
DPRINT("Sending bogus WM_SIZE\n"); DPRINT("Sending bogus WM_SIZE\n");
} }
lParam = MAKE_LONG(Window->Wnd->ClientRect.right - lParam = MAKE_LONG(Window->Wnd->ClientRect.right -
Window->Wnd->ClientRect.left, Window->Wnd->ClientRect.left,
Window->Wnd->ClientRect.bottom - Window->Wnd->ClientRect.bottom -
@ -2073,7 +2072,6 @@ AllocErr:
co_IntSendMessage(Window->hSelf, WM_SIZE, SIZE_RESTORED, co_IntSendMessage(Window->hSelf, WM_SIZE, SIZE_RESTORED,
lParam); lParam);
DPRINT("IntCreateWindow(): About to send WM_MOVE\n"); DPRINT("IntCreateWindow(): About to send WM_MOVE\n");
if (0 != (Wnd->Style & WS_CHILD) && ParentWindow) if (0 != (Wnd->Style & WS_CHILD) && ParentWindow)
@ -2087,14 +2085,10 @@ AllocErr:
Wnd->ClientRect.top); Wnd->ClientRect.top);
} }
co_IntSendMessage(Window->hSelf, WM_MOVE, 0, lParam); co_IntSendMessage(Window->hSelf, WM_MOVE, 0, lParam);
/* Call WNDOBJ change procs */ /* Call WNDOBJ change procs */
IntEngWindowChanged(Window, WOC_RGN_CLIENT); IntEngWindowChanged(Window, WOC_RGN_CLIENT);
} }
/* Show or maybe minimize or maximize the window. */ /* Show or maybe minimize or maximize the window. */
@ -2105,11 +2099,13 @@ AllocErr:
SwFlag = (Wnd->Style & WS_MINIMIZE) ? SW_MINIMIZE : SwFlag = (Wnd->Style & WS_MINIMIZE) ? SW_MINIMIZE :
SW_MAXIMIZE; SW_MAXIMIZE;
co_WinPosMinMaximize(Window, SwFlag, &NewPos); co_WinPosMinMaximize(Window, SwFlag, &NewPos);
SwFlag =
((Wnd->Style & WS_CHILD) || UserGetActiveWindow()) ? SwFlag = ((Wnd->Style & WS_CHILD) || UserGetActiveWindow()) ?
SWP_NOACTIVATE | SWP_NOZORDER | SWP_FRAMECHANGED : SWP_NOACTIVATE | SWP_NOZORDER | SWP_FRAMECHANGED :
SWP_NOZORDER | SWP_FRAMECHANGED; SWP_NOZORDER | SWP_FRAMECHANGED;
DPRINT("IntCreateWindow(): About to minimize/maximize\n"); DPRINT("IntCreateWindow(): About to minimize/maximize\n");
DPRINT("%d,%d %dx%d\n", NewPos.left, NewPos.top, NewPos.right, NewPos.bottom); DPRINT("%d,%d %dx%d\n", NewPos.left, NewPos.top, NewPos.right, NewPos.bottom);
co_WinPosSetWindowPos(Window, 0, NewPos.left, NewPos.top, co_WinPosSetWindowPos(Window, 0, NewPos.left, NewPos.top,
@ -2149,8 +2145,20 @@ AllocErr:
if (dwStyle & WS_VISIBLE) if (dwStyle & WS_VISIBLE)
{ {
if (Wnd->Style & WS_MAXIMIZE)
dwShowMode = SW_SHOW;
else if (Wnd->Style & WS_MINIMIZE)
dwShowMode = SW_SHOWMINIMIZED;
DPRINT("IntCreateWindow(): About to show window\n"); DPRINT("IntCreateWindow(): About to show window\n");
co_WinPosShowWindow(Window, dwShowMode); co_WinPosShowWindow(Window, dwShowMode);
if (Wnd->ExStyle & WS_EX_MDICHILD)
{
co_IntSendMessage(ParentWindow->hSelf, WM_MDIREFRESHMENU, 0, 0);
/* ShowWindow won't activate child windows */
co_WinPosSetWindowPos(Window, HWND_TOP, 0, 0, 0, 0, SWP_SHOWWINDOW | SWP_NOMOVE | SWP_NOSIZE);
}
} }
DPRINT("IntCreateWindow(): = %X\n", hWnd); DPRINT("IntCreateWindow(): = %X\n", hWnd);