mirror of
https://github.com/reactos/reactos.git
synced 2025-06-24 22:39:47 +00:00
[RSHELL]
* Fix some small things that were getting in the way of fixing the start menu (which was broken and no one noticed). The actual fix will come tomorrow since my brain is about to implode at this time. svn path=/branches/shell-experiments/; revision=65065
This commit is contained in:
parent
c199f8be2e
commit
dc1da96ab8
5 changed files with 49 additions and 18 deletions
|
@ -909,6 +909,7 @@ HRESULT CMenuBand::_KeyboardItemChange(DWORD change)
|
||||||
|
|
||||||
HRESULT CMenuBand::_MenuItemHotTrack(DWORD changeType)
|
HRESULT CMenuBand::_MenuItemHotTrack(DWORD changeType)
|
||||||
{
|
{
|
||||||
|
CComPtr<CMenuBand> safeThis = this;
|
||||||
HRESULT hr;
|
HRESULT hr;
|
||||||
|
|
||||||
if (m_dwFlags & SMINIT_VERTICAL)
|
if (m_dwFlags & SMINIT_VERTICAL)
|
||||||
|
@ -951,6 +952,7 @@ HRESULT CMenuBand::_MenuItemHotTrack(DWORD changeType)
|
||||||
{
|
{
|
||||||
m_subMenuParent->OnSelect(changeType);
|
m_subMenuParent->OnSelect(changeType);
|
||||||
}
|
}
|
||||||
|
TRACE("Menu closed, executing item...\n");
|
||||||
m_hotBar->ExecuteItem(m_hotItem);
|
m_hotBar->ExecuteItem(m_hotItem);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
|
|
@ -131,11 +131,15 @@ HRESULT STDMETHODCALLTYPE CMenuDeskBar::Exec(const GUID *pguidCmdGroup, DWORD nC
|
||||||
|
|
||||||
HRESULT STDMETHODCALLTYPE CMenuDeskBar::QueryService(REFGUID guidService, REFIID riid, void **ppvObject)
|
HRESULT STDMETHODCALLTYPE CMenuDeskBar::QueryService(REFGUID guidService, REFIID riid, void **ppvObject)
|
||||||
{
|
{
|
||||||
|
HRESULT hr;
|
||||||
|
|
||||||
if (IsEqualGUID(guidService, SID_SMenuPopup) ||
|
if (IsEqualGUID(guidService, SID_SMenuPopup) ||
|
||||||
IsEqualGUID(guidService, SID_SMenuBandParent) ||
|
IsEqualGUID(guidService, SID_SMenuBandParent) ||
|
||||||
IsEqualGUID(guidService, SID_STopLevelBrowser))
|
IsEqualGUID(guidService, SID_STopLevelBrowser))
|
||||||
{
|
{
|
||||||
return this->QueryInterface(riid, ppvObject);
|
hr = this->QueryInterface(riid, ppvObject);
|
||||||
|
if (SUCCEEDED(hr))
|
||||||
|
return hr;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (IsEqualGUID(guidService, SID_SMenuBandBottom) ||
|
if (IsEqualGUID(guidService, SID_SMenuBandBottom) ||
|
||||||
|
@ -145,7 +149,9 @@ HRESULT STDMETHODCALLTYPE CMenuDeskBar::QueryService(REFGUID guidService, REFIID
|
||||||
if (m_Client == NULL)
|
if (m_Client == NULL)
|
||||||
return E_NOINTERFACE;
|
return E_NOINTERFACE;
|
||||||
|
|
||||||
return IUnknown_QueryService(m_Client, guidService, riid, ppvObject);
|
hr = IUnknown_QueryService(m_Client, guidService, riid, ppvObject);
|
||||||
|
if (SUCCEEDED(hr))
|
||||||
|
return hr;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -484,6 +490,8 @@ HRESULT STDMETHODCALLTYPE CMenuDeskBar::OnSelect(DWORD dwSelectType)
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
CComPtr<IMenuPopup> oldParent = m_SubMenuParent;
|
||||||
|
|
||||||
switch (dwSelectType)
|
switch (dwSelectType)
|
||||||
{
|
{
|
||||||
case MPOS_EXECUTE:
|
case MPOS_EXECUTE:
|
||||||
|
@ -498,8 +506,8 @@ HRESULT STDMETHODCALLTYPE CMenuDeskBar::OnSelect(DWORD dwSelectType)
|
||||||
case MPOS_SELECTLEFT:
|
case MPOS_SELECTLEFT:
|
||||||
case MPOS_SELECTRIGHT:
|
case MPOS_SELECTRIGHT:
|
||||||
case MPOS_CHILDTRACKING:
|
case MPOS_CHILDTRACKING:
|
||||||
if (m_SubMenuParent)
|
if (oldParent)
|
||||||
return m_SubMenuParent->OnSelect(dwSelectType);
|
return oldParent->OnSelect(dwSelectType);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -832,6 +832,11 @@ HRESULT CMenuFocusManager::PopMenuBar(CMenuBand * mb)
|
||||||
|
|
||||||
DbgPrint("PopMenuBar %p\n", mb);
|
DbgPrint("PopMenuBar %p\n", mb);
|
||||||
|
|
||||||
|
if (m_current == m_entryUnderMouse)
|
||||||
|
{
|
||||||
|
m_entryUnderMouse = NULL;
|
||||||
|
}
|
||||||
|
|
||||||
hr = PopFromArray(&type, &mbc, NULL);
|
hr = PopFromArray(&type, &mbc, NULL);
|
||||||
if (FAILED_UNEXPECTEDLY(hr))
|
if (FAILED_UNEXPECTEDLY(hr))
|
||||||
{
|
{
|
||||||
|
@ -871,6 +876,11 @@ HRESULT CMenuFocusManager::PopMenuPopup(CMenuBand * mb)
|
||||||
|
|
||||||
DbgPrint("PopMenuPopup %p\n", mb);
|
DbgPrint("PopMenuPopup %p\n", mb);
|
||||||
|
|
||||||
|
if (m_current == m_entryUnderMouse)
|
||||||
|
{
|
||||||
|
m_entryUnderMouse = NULL;
|
||||||
|
}
|
||||||
|
|
||||||
hr = PopFromArray(&type, &mbc, NULL);
|
hr = PopFromArray(&type, &mbc, NULL);
|
||||||
if (FAILED_UNEXPECTEDLY(hr))
|
if (FAILED_UNEXPECTEDLY(hr))
|
||||||
{
|
{
|
||||||
|
|
|
@ -37,6 +37,11 @@
|
||||||
|
|
||||||
#define COBJMACROS
|
#define COBJMACROS
|
||||||
|
|
||||||
|
//#define DEBUG_CCOMOBJECT
|
||||||
|
//#define DEBUG_CCOMOBJECT_CREATION 1
|
||||||
|
//#define DEBUG_CCOMOBJECT_DESTRUCTION 1
|
||||||
|
//#define DEBUG_CCOMOBJECT_REFCOUNTING 0
|
||||||
|
|
||||||
#include <windef.h>
|
#include <windef.h>
|
||||||
#include <winbase.h>
|
#include <winbase.h>
|
||||||
#include <winreg.h>
|
#include <winreg.h>
|
||||||
|
|
|
@ -626,6 +626,9 @@ class CComDebugObject : public Base
|
||||||
public:
|
public:
|
||||||
CComDebugObject(void * = NULL)
|
CComDebugObject(void * = NULL)
|
||||||
{
|
{
|
||||||
|
#if DEBUG_CCOMOBJECT_CREATION
|
||||||
|
DbgPrint("%S, this=%08p\n", __FUNCTION__, static_cast<Base*>(this));
|
||||||
|
#endif
|
||||||
_pAtlModule->Lock();
|
_pAtlModule->Lock();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -638,25 +641,28 @@ public:
|
||||||
STDMETHOD_(ULONG, AddRef)()
|
STDMETHOD_(ULONG, AddRef)()
|
||||||
{
|
{
|
||||||
int rc = this->InternalAddRef();
|
int rc = this->InternalAddRef();
|
||||||
DbgPrint("RefCount is now %d(++)! %s\n", rc, __FUNCTION__);
|
#if DEBUG_CCOMOBJECT_REFCOUNTING
|
||||||
|
DbgPrint("%s, RefCount is now %d(--)! \n", __FUNCTION__, rc);
|
||||||
|
#endif
|
||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
|
|
||||||
STDMETHOD_(ULONG, Release)()
|
STDMETHOD_(ULONG, Release)()
|
||||||
{
|
{
|
||||||
ULONG newRefCount;
|
int rc = this->InternalRelease();
|
||||||
|
|
||||||
newRefCount = this->InternalRelease();
|
#if DEBUG_CCOMOBJECT_REFCOUNTING
|
||||||
if (newRefCount == 0)
|
DbgPrint("%s, RefCount is now %d(--)! \n", __FUNCTION__, rc);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
if (rc == 0)
|
||||||
{
|
{
|
||||||
DbgPrint("RefCount is now 0! Deleting! %s\n", newRefCount, __FUNCTION__);
|
#if DEBUG_CCOMOBJECT_DESTRUCTION
|
||||||
|
DbgPrint("%s, RefCount reached 0 Deleting!\n", __FUNCTION__);
|
||||||
|
#endif
|
||||||
delete this;
|
delete this;
|
||||||
}
|
}
|
||||||
else
|
return rc;
|
||||||
{
|
|
||||||
DbgPrint("RefCount is now %d(--)! %s\n", newRefCount, __FUNCTION__);
|
|
||||||
}
|
|
||||||
return newRefCount;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
STDMETHOD(QueryInterface)(REFIID iid, void **ppvObject)
|
STDMETHOD(QueryInterface)(REFIID iid, void **ppvObject)
|
||||||
|
@ -675,9 +681,9 @@ public:
|
||||||
|
|
||||||
hResult = E_OUTOFMEMORY;
|
hResult = E_OUTOFMEMORY;
|
||||||
newInstance = NULL;
|
newInstance = NULL;
|
||||||
ATLTRY(newInstance = new CComDebugObject<Base>())
|
ATLTRY(newInstance = new CComDebugObject<Base>());
|
||||||
if (newInstance != NULL)
|
if (newInstance != NULL)
|
||||||
{
|
{
|
||||||
newInstance->SetVoid(NULL);
|
newInstance->SetVoid(NULL);
|
||||||
newInstance->InternalFinalConstructAddRef();
|
newInstance->InternalFinalConstructAddRef();
|
||||||
hResult = newInstance->_AtlInitialConstruct();
|
hResult = newInstance->_AtlInitialConstruct();
|
||||||
|
@ -691,7 +697,7 @@ public:
|
||||||
delete newInstance;
|
delete newInstance;
|
||||||
newInstance = NULL;
|
newInstance = NULL;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
*pp = newInstance;
|
*pp = newInstance;
|
||||||
return hResult;
|
return hResult;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue