Skip to content

Commit

Permalink
Fix issue #2084: Close main window with 'Esc' if there is only one MD…
Browse files Browse the repository at this point in the history
…I child window
  • Loading branch information
sdottaka committed Nov 3, 2023
1 parent 64d0eed commit f9b021c
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 5 deletions.
4 changes: 1 addition & 3 deletions Src/HexMergeView.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -538,15 +538,13 @@ void CHexMergeView::OnEditClear()
*/
BOOL CHexMergeView::PreTranslateMessage(MSG* pMsg)
{
if (GetTopLevelFrame()->PreTranslateMessage(pMsg))
return TRUE;
if (pMsg->message == WM_KEYDOWN)
{
// Close window in response to VK_ESCAPE if user has allowed it from options
if (pMsg->wParam == VK_ESCAPE && GetOptionsMgr()->GetInt(OPT_CLOSE_WITH_ESC) != 0)
{
GetParentFrame()->PostMessage(WM_CLOSE, 0, 0);
return TRUE;
return false;
}
}
return m_pif->translate_accelerator(pMsg);
Expand Down
2 changes: 1 addition & 1 deletion Src/ImgMergeFrm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1354,7 +1354,7 @@ BOOL CImgMergeFrame::PreTranslateMessage(MSG* pMsg)
if (pMsg->wParam == VK_ESCAPE && GetOptionsMgr()->GetInt(OPT_CLOSE_WITH_ESC) != 0)
{
PostMessage(WM_CLOSE, 0, 0);
return true;
return false;
}
}
return CMergeFrameCommon::PreTranslateMessage(pMsg);
Expand Down
2 changes: 1 addition & 1 deletion Src/WebPageDiffFrm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -980,7 +980,7 @@ BOOL CWebPageDiffFrame::PreTranslateMessage(MSG* pMsg)
if (pMsg->wParam == VK_ESCAPE && GetOptionsMgr()->GetInt(OPT_CLOSE_WITH_ESC) != 0)
{
PostMessage(WM_CLOSE, 0, 0);
return true;
return false;
}
}
return CMergeFrameCommon::PreTranslateMessage(pMsg);
Expand Down

0 comments on commit f9b021c

Please sign in to comment.