diff options
Diffstat (limited to 'chrome/views/custom_frame_window.cc')
-rw-r--r-- | chrome/views/custom_frame_window.cc | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/chrome/views/custom_frame_window.cc b/chrome/views/custom_frame_window.cc index 5dc425a..2a96cb9 100644 --- a/chrome/views/custom_frame_window.cc +++ b/chrome/views/custom_frame_window.cc @@ -1180,6 +1180,11 @@ void CustomFrameWindow::OnSize(UINT param, const CSize& size) { // CustomFrameWindow, private: void CustomFrameWindow::RunSystemMenu(const CPoint& point) { + // We need to reset and clean up any currently created system menu objects. + // We need to call this otherwise there's a small chance that we aren't going + // to get a system menu. We also can't take the return value of this + // function. We need to call it *again* to get a valid HMENU. + ::GetSystemMenu(GetHWND(), TRUE); HMENU system_menu = ::GetSystemMenu(GetHWND(), FALSE); int id = ::TrackPopupMenu(system_menu, TPM_LEFTBUTTON | TPM_RIGHTBUTTON | TPM_RETURNCMD, |