* Prevent the focused window from receiving keyboard events while a shell menu is open.
CORE-7586

svn path=/branches/shell-experiments/; revision=62935
This commit is contained in:
David Quintana 2014-04-24 11:25:46 +00:00
parent 78790baf2e
commit 663bc1da24
4 changed files with 20 additions and 2 deletions

View file

@ -868,6 +868,10 @@ HRESULT CMenuBand::_MenuItemHotTrack(DWORD changeType)
switch (changeType)
{
case MPOS_EXECUTE:
m_hotBar->ExecuteItem(m_hotItem);
break;
case MPOS_SELECTLEFT:
if (m_parentBand && m_parentBand->_IsPopup()==S_FALSE)
return m_parentBand->_MenuItemHotTrack(VK_LEFT);

View file

@ -442,6 +442,9 @@ LRESULT CMenuFocusManager::GetMsgHook(INT nCode, WPARAM hookWParam, LPARAM hookL
case VK_RMENU:
m_current->mb->_MenuItemHotTrack(MPOS_FULLCANCEL);
break;
case VK_RETURN:
m_current->mb->_MenuItemHotTrack(MPOS_EXECUTE);
break;
case VK_LEFT:
m_current->mb->_MenuItemHotTrack(VK_LEFT);
break;
@ -455,6 +458,9 @@ LRESULT CMenuFocusManager::GetMsgHook(INT nCode, WPARAM hookWParam, LPARAM hookL
m_current->mb->_MenuItemHotTrack(VK_DOWN);
break;
}
msg->message = WM_NULL;
msg->lParam = 0;
msg->wParam = 0;
}
break;
}

View file

@ -814,9 +814,16 @@ HRESULT CMenuToolbarBase::OnCommand(WPARAM wParam, LPARAM lParam, LRESULT *theRe
*theResult = 0;
INT iItem = (INT)wParam;
return ExecuteItem(iItem);
}
HRESULT CMenuToolbarBase::ExecuteItem(INT iItem)
{
m_menuBand->_KillPopupTimers();
if (PopupItem(wParam) == S_OK)
if (PopupItem(iItem) == S_OK)
{
TRACE("PopupItem returned S_OK\n");
return S_FALSE;
@ -829,7 +836,6 @@ HRESULT CMenuToolbarBase::OnCommand(WPARAM wParam, LPARAM lParam, LRESULT *theRe
if (FAILED_UNEXPECTEDLY(hr))
return hr;
INT iItem = wParam;
INT index;
DWORD_PTR data;

View file

@ -77,6 +77,8 @@ public:
HRESULT KeyboardItemChange(DWORD changeType);
HRESULT ExecuteItem(INT iItem);
HRESULT IsTrackedItem(INT index);
HRESULT ChangeTrackedItem(INT index, BOOL wasTracking, BOOL mouse);