Skip to content

Commit

Permalink
修复最近修改的dialog关闭动画可能导致窗口卡死的BUG。
Browse files Browse the repository at this point in the history
ver:4.6.0.5
  • Loading branch information
huangjianxiong1 committed Sep 21, 2023
1 parent 53f4465 commit be9e5d9
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 9 deletions.
2 changes: 1 addition & 1 deletion SOUI/include/soui-version.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@
#define SOUI_VER1 4
#define SOUI_VER2 6
#define SOUI_VER3 0
#define SOUI_VER4 4
#define SOUI_VER4 5
9 changes: 5 additions & 4 deletions SOUI/src/core/SHostDialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -61,17 +61,18 @@ INT_PTR SHostDialog::DoModal(HWND hParent /*=NULL*/)

int nRet = m_MsgLoop->Run();

if (m_nRetCode == RC_INIT)
{ //不是自己主动使用EndDialog关闭窗口,重新把WM_QUIT放回消息队列。
PostQuitMessage(nRet);
}
// From MFC
// hide the window before enabling the parent, etc.
if (IsWindow())
{
ShowHostWnd(SW_HIDE, TRUE);
}

if (m_nRetCode == RC_INIT)
{ //不是自己主动使用EndDialog关闭窗口,重新把WM_QUIT放回消息队列。
PostQuitMessage(nRet);
}

if (bEnableParent)
{
::EnableWindow(hParent, TRUE);
Expand Down
6 changes: 3 additions & 3 deletions SOUI/src/core/SMsgLoop.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -231,13 +231,13 @@ BOOL SMessageLoop::PeekMsg(THIS_ LPMSG pMsg, UINT wMsgFilterMin, UINT wMsgFilter
BOOL SMessageLoop::WaitMsg(THIS)
{
MSG msg;
while (m_bDoIdle && !PeekMsg(&msg, 0, 0, FALSE))
while (!m_bQuit && m_bDoIdle && !PeekMsg(&msg, 0, 0, FALSE))
{
if (!OnIdle(m_nIdleCount++))
m_bDoIdle = FALSE;
if (m_bQuit)
return FALSE;
}
if (m_bQuit)
return FALSE;
return ::WaitMessage();
}

Expand Down
3 changes: 2 additions & 1 deletion SOUI/src/core/shostwnd.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1925,7 +1925,8 @@ void SHostWnd::ShowHostWnd(THIS_ int nShowCmd, BOOL bWaitAniDone)
SApplication::getSingletonPtr()->GetMsgLoopFactory()->CreateMsgLoop(&msgLoop, GetMsgLoop());
for (; m_AniState & Ani_win;)
{
msgLoop->WaitMsg();
if(!msgLoop->WaitMsg())
break;
msgLoop->HandleMsg();
}
}
Expand Down

0 comments on commit be9e5d9

Please sign in to comment.