Author: dquintana
Date: Tue Oct 28 15:39:47 2014
New Revision: 65074
URL:
http://svn.reactos.org/svn/reactos?rev=65074&view=rev
Log:
[RSHELL]
* Fix executing items after the menu has closed.
Modified:
branches/shell-experiments/base/shell/rshell/CMenuBand.cpp
branches/shell-experiments/base/shell/rshell/CMenuToolbars.cpp
branches/shell-experiments/base/shell/rshell/CMenuToolbars.h
Modified: branches/shell-experiments/base/shell/rshell/CMenuBand.cpp
URL:
http://svn.reactos.org/svn/reactos/branches/shell-experiments/base/shell/rs…
==============================================================================
--- branches/shell-experiments/base/shell/rshell/CMenuBand.cpp [iso-8859-1] (original)
+++ branches/shell-experiments/base/shell/rshell/CMenuBand.cpp [iso-8859-1] Tue Oct 28
15:39:47 2014
@@ -948,14 +948,18 @@
switch (changeType)
{
case MPOS_EXECUTE:
+ {
+ CMenuToolbarBase * tb = m_hotBar;
+ int item = m_hotItem;
+ tb->PrepareExecuteItem(item);
if (m_subMenuParent)
{
m_subMenuParent->OnSelect(changeType);
}
TRACE("Menu closed, executing item...\n");
- m_hotBar->ExecuteItem(m_hotItem);
+ tb->ExecuteItem();
break;
-
+ }
case MPOS_SELECTLEFT:
if (m_parentBand && m_parentBand->_IsPopup()==S_FALSE)
return m_parentBand->_MenuItemHotTrack(VK_LEFT);
Modified: branches/shell-experiments/base/shell/rshell/CMenuToolbars.cpp
URL:
http://svn.reactos.org/svn/reactos/branches/shell-experiments/base/shell/rs…
==============================================================================
--- branches/shell-experiments/base/shell/rshell/CMenuToolbars.cpp [iso-8859-1]
(original)
+++ branches/shell-experiments/base/shell/rshell/CMenuToolbars.cpp [iso-8859-1] Tue Oct 28
15:39:47 2014
@@ -846,16 +846,17 @@
return ProcessClick(btn.idCommand);
}
-HRESULT CMenuToolbarBase::ExecuteItem(INT iItem)
+HRESULT CMenuToolbarBase::PrepareExecuteItem(INT iItem)
{
this->m_menuBand->_KillPopupTimers();
- INT index;
- DWORD_PTR data;
-
- GetDataFromId(iItem, &index, &data);
-
- return InternalExecuteItem(iItem, index, data);
+ m_executeItem = iItem;
+ return GetDataFromId(iItem, &m_executeIndex, &m_executeData);
+}
+
+HRESULT CMenuToolbarBase::ExecuteItem()
+{
+ return InternalExecuteItem(m_executeItem, m_executeItem, m_executeData);
}
HRESULT CMenuToolbarBase::OnContextMenu(NMMOUSE * rclick)
Modified: branches/shell-experiments/base/shell/rshell/CMenuToolbars.h
URL:
http://svn.reactos.org/svn/reactos/branches/shell-experiments/base/shell/rs…
==============================================================================
--- branches/shell-experiments/base/shell/rshell/CMenuToolbars.h [iso-8859-1] (original)
+++ branches/shell-experiments/base/shell/rshell/CMenuToolbars.h [iso-8859-1] Tue Oct 28
15:39:47 2014
@@ -51,6 +51,10 @@
DWORD m_initFlags;
BOOL m_isTrackingPopup;
+ INT m_executeIndex;
+ INT m_executeItem;
+ DWORD_PTR m_executeData;
+
private:
static LRESULT CALLBACK s_SubclassProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM
lParam);
@@ -77,7 +81,8 @@
HRESULT KeyboardItemChange(DWORD changeType);
- HRESULT ExecuteItem(INT iItem);
+ HRESULT PrepareExecuteItem(INT iItem);
+ HRESULT ExecuteItem();
HRESULT IsTrackedItem(INT index);
HRESULT ChangeTrackedItem(INT index, BOOL wasTracking, BOOL mouse);