Don't close menu(s) on certain operations

In several cases we don't want menu(s) to close when an action on menu was
done. For example on drag-n-drop or menu item deletion (where confirmation
dialog is shown).

In such situations `s_bPreventClosing` was set to true (and then back to
false when closing was allowed again).
Though original code honored this variable only in certain situations and
typically (at least on Win10) menus were hidden/closed despite of it.

This patch changes the behavior and menus(s) are not closed when
`s_bPreventClosing` is set to true.
Basically now menu(s) stay visible until there is an action that changes
active window.

Following functionality was also removed because it is not needed now:

* CMenuContainer::HideTemp
* COwnerWindow::OnClear
  WM_CLEAR was sent to the window only by already removed `HideTemp`
This commit is contained in:
ge0rdi
2019-10-13 17:31:58 +02:00
committed by ge0rdi
parent f33cd60b84
commit fe47f841e7
6 changed files with 16 additions and 68 deletions
@@ -957,7 +957,6 @@ private:
friend LRESULT CALLBACK SubclassTopMenuProc( HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam, UINT_PTR uIdSubclass, DWORD_PTR dwRefData );
friend HRESULT CreatePinLink( PCIDLIST_ABSOLUTE sourcePidl, const wchar_t *name, const wchar_t *iconPath, int iconIndex );
static void HideTemp( bool bHide );
static void AddMRUShortcut( const wchar_t *path );
static void AddMRUAppId( const wchar_t *appid );
static void DeleteMRUShortcut( const wchar_t *path );