* Workaround for the exec issue. Ros currently seems to send a bogus WM_ACTIVATE message when clicking while the window is already active. Proper fix may come later if I can figure out why this happens.

CORE-7586

svn path=/branches/shell-experiments/; revision=62475
This commit is contained in:
David Quintana 2014-03-11 17:40:18 +00:00
parent 683375abdb
commit 905eb2bdce
4 changed files with 20 additions and 4 deletions

View file

@ -2610,7 +2610,7 @@ HandleTrayContextMenu:
} }
if (This->TrayBandSite == NULL || if (This->TrayBandSite == NULL ||
!SUCCEEDED(ITrayBandSite_ProcessMessage(This->TrayBandSite, FAILED(ITrayBandSite_ProcessMessage(This->TrayBandSite,
hwnd, hwnd,
uMsg, uMsg,
wParam, wParam,

View file

@ -491,7 +491,7 @@ HRESULT CMenuDeskBar::_CloseBar()
if (FAILED_UNEXPECTEDLY(hr)) if (FAILED_UNEXPECTEDLY(hr))
return hr; return hr;
SetWindowPos(m_hWnd, 0, 0, 0, 0, SWP_HIDEWINDOW | SWP_NOACTIVATE | SWP_NOMOVE | SWP_NOZORDER); SetWindowPos(NULL, 0, 0, 0, 0, SWP_HIDEWINDOW | SWP_NOACTIVATE | SWP_NOMOVE);
return UIActivateIO(FALSE, NULL); return UIActivateIO(FALSE, NULL);
} }
@ -609,8 +609,13 @@ LRESULT CMenuDeskBar::_OnPaint(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bH
LRESULT CMenuDeskBar::_OnActivate(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled) LRESULT CMenuDeskBar::_OnActivate(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
{ {
if (wParam != 0) DbgPrint("BaseBar %08p (de)activated (%08x, %08x).\n", m_hWnd, wParam, lParam);
// BUG in ReactOS: WM_ACTIVATE/WA_INACTIVE makes no sense with lParam==hWnd
if (LOWORD(wParam) != 0 || reinterpret_cast<HWND>(lParam) == m_hWnd)
{
return 0; return 0;
}
// HACK! I just want it to work !!! // HACK! I just want it to work !!!
CComPtr<IDeskBar> db; CComPtr<IDeskBar> db;

View file

@ -622,7 +622,10 @@ HRESULT CMenuToolbarBase::OnCommand(WPARAM wParam, LPARAM lParam, LRESULT *theRe
PopupItem(wParam); PopupItem(wParam);
return S_FALSE; return S_FALSE;
} }
return m_menuBand->_MenuItemHotTrack(MPOS_EXECUTE); HRESULT hr = m_menuBand->_MenuItemHotTrack(MPOS_EXECUTE);
if (FAILED_UNEXPECTEDLY(hr))
return hr;
return S_OK; // filter out a possible S_FALSE from here.
} }
HRESULT CMenuToolbarBase::ChangeHotItem(DWORD dwSelectType) HRESULT CMenuToolbarBase::ChangeHotItem(DWORD dwSelectType)
@ -938,7 +941,10 @@ HRESULT CMenuStaticToolbar::OnCommand(WPARAM wParam, LPARAM lParam, LRESULT *the
// in case the clicked item has a submenu, we do not need to execute the item // in case the clicked item has a submenu, we do not need to execute the item
if (hr == S_FALSE) if (hr == S_FALSE)
{
DbgPrint("CMenuToolbarBase::OnCommand told us to cancel.\n");
return hr; return hr;
}
return m_menuBand->_CallCBWithItemId(wParam, SMC_EXEC, 0, 0); return m_menuBand->_CallCBWithItemId(wParam, SMC_EXEC, 0, 0);
} }
@ -1102,7 +1108,10 @@ HRESULT CMenuSFToolbar::OnCommand(WPARAM wParam, LPARAM lParam, LRESULT *theResu
// in case the clicked item has a submenu, we do not need to execute the item // in case the clicked item has a submenu, we do not need to execute the item
if (hr == S_FALSE) if (hr == S_FALSE)
{
DbgPrint("CMenuToolbarBase::OnCommand told us to cancel.\n");
return hr; return hr;
}
DWORD_PTR data; DWORD_PTR data;
GetDataFromId(wParam, NULL, &data); GetDataFromId(wParam, NULL, &data);

View file

@ -267,8 +267,10 @@ public:
case SMC_GETOBJECT: case SMC_GETOBJECT:
return OnGetObject(psmd, *reinterpret_cast<IID *>(wParam), reinterpret_cast<void **>(lParam)); return OnGetObject(psmd, *reinterpret_cast<IID *>(wParam), reinterpret_cast<void **>(lParam));
case SMC_EXEC: case SMC_EXEC:
DbgPrint("SMC_EXEC\n");
return OnExec(psmd); return OnExec(psmd);
case SMC_SFEXEC: case SMC_SFEXEC:
DbgPrint("SMC_SFEXEC\n");
m_pTrayPriv->Execute(psmd->psf, psmd->pidlItem); m_pTrayPriv->Execute(psmd->psf, psmd->pidlItem);
break; break;
} }