diff --git a/include/win.h b/include/win.h index 65f4108b008..5e7d5dd85eb 100644 --- a/include/win.h +++ b/include/win.h @@ -154,6 +154,7 @@ typedef struct #define WIN_MANAGED 0x0100 /* Window managed by the window system */ #define WIN_ISDIALOG 0x0200 /* Window is a dialog */ #define WIN_ISWIN32 0x0400 /* Understands Win32 messages */ +#define WIN_NEEDS_SHOW_OWNEDPOPUP 0x0800 /* WM_SHOWWINDOW:SC_SHOW must be sent in the next ShowOwnedPopup call */ /* BuildWinArray() flags */ #define BWA_SKIPDISABLED 0x0001 diff --git a/windows/win.c b/windows/win.c index 938b48c62c9..ece99d955e8 100644 --- a/windows/win.c +++ b/windows/win.c @@ -2668,7 +2668,24 @@ BOOL WINAPI ShowOwnedPopups( HWND owner, BOOL fShow ) for (; count < totalChild; count++) { if (pWnd[count]->owner && (pWnd[count]->owner->hwndSelf == owner) && (pWnd[count]->dwStyle & WS_POPUP)) - SendMessageA(pWnd[count]->hwndSelf, WM_SHOWWINDOW, fShow ? SW_SHOW : SW_HIDE,IsIconic(owner) ? SW_PARENTOPENING : SW_PARENTCLOSING); + { + if (fShow) + { + if (pWnd[count]->flags & WIN_NEEDS_SHOW_OWNEDPOPUP) + { + SendMessageA(pWnd[count]->hwndSelf, WM_SHOWWINDOW, SW_SHOW, IsIconic(owner) ? SW_PARENTOPENING : SW_PARENTCLOSING); + pWnd[count]->flags &= ~WIN_NEEDS_SHOW_OWNEDPOPUP; + } + } + else + { + if (IsWindowVisible(pWnd[count]->hwndSelf)) + { + SendMessageA(pWnd[count]->hwndSelf, WM_SHOWWINDOW, SW_HIDE, IsIconic(owner) ? SW_PARENTOPENING : SW_PARENTCLOSING); + pWnd[count]->flags |= WIN_NEEDS_SHOW_OWNEDPOPUP; + } + } + } } WIN_ReleaseDesktop();