- Fix regression from r71846. See CORE-11479 for more details.

svn path=/trunk/; revision=72180
This commit is contained in:
James Tabor 2016-08-10 00:16:57 +00:00
parent 6927d67350
commit 824b41c0b2
2 changed files with 34 additions and 4 deletions

View file

@ -944,9 +944,12 @@ VOID UserDrawCaptionBar(
if (!(Style & WS_MINIMIZE))
{
/* Draw menu bar */
if (HAS_MENU(pWnd, Style))
if (pWnd->state & WNDS_HASMENU)
{
CurrentRect.top += MENU_DrawMenuBar(hDC, &CurrentRect, pWnd, FALSE);
PMENU menu = UserGetMenuObject(UlongToHandle(pWnd->IDMenu)); // FIXME!
TempRect = CurrentRect;
TempRect.bottom = TempRect.top + menu->cyMenu; // Should be pWnd->spmenu->cyMenu;
CurrentRect.top += MENU_DrawMenuBar(hDC, &TempRect, pWnd, FALSE);
}
if (ExStyle & WS_EX_CLIENTEDGE)
@ -1110,11 +1113,14 @@ NC_DoNCPaint(PWND pWnd, HDC hDC, INT Flags)
if (!(Style & WS_MINIMIZE))
{
/* Draw menu bar */
if (HAS_MENU(pWnd, Style))
if (pWnd->state & WNDS_HASMENU)
{
if (!(Flags & DC_NOSENDMSG))
{
CurrentRect.top += MENU_DrawMenuBar(hDC, &CurrentRect, pWnd, FALSE);
PMENU menu = UserGetMenuObject(UlongToHandle(pWnd->IDMenu)); // FIXME!
TempRect = CurrentRect;
TempRect.bottom = TempRect.top + menu->cyMenu; // Should be pWnd->spmenu->cyMenu;
CurrentRect.top += MENU_DrawMenuBar(hDC, &TempRect, pWnd, FALSE);
}
}

View file

@ -3595,6 +3595,30 @@ co_IntSetWindowLong(HWND hWnd, DWORD Index, LONG NewValue, BOOL Ansi, BOOL bAlte
else
Window->ExStyle &= ~WS_EX_WINDOWEDGE;
if ((OldValue & (WS_CHILD | WS_POPUP)) == WS_CHILD)
{
if ((NewValue & (WS_CHILD | WS_POPUP)) != WS_CHILD)
{
//// From child to non-child it should be null already.
ERR("IDMenu going null! %d\n",Window->IDMenu);
Window->IDMenu = 0; // Window->spmenu = 0;
}
}
else
{
if ((NewValue & (WS_CHILD | WS_POPUP)) == WS_CHILD)
{
PMENU pMenu = UserGetMenuObject(UlongToHandle(Window->IDMenu));
Window->state &= ~WNDS_HASMENU;
if (pMenu)
{
ERR("IDMenu released 0x%p\n",pMenu);
// ROS may not hold a lock after setting menu to window. But it should!
//IntReleaseMenuObject(pMenu);
}
}
}
if ((Style.styleOld ^ Style.styleNew) & WS_VISIBLE)
{
if (Style.styleOld & WS_VISIBLE) Window->head.pti->cVisWindows--;