Module: wine
Branch: master
Commit: 6fd349c6e0262d0b4c5739c90883131c1b145818
URL: https://gitlab.winehq.org/wine/wine/-/commit/6fd349c6e0262d0b4c5739c9088313…
Author: Zebediah Figura <zfigura(a)codeweavers.com>
Date: Fri Feb 16 22:02:54 2024 -0600
shell32: Do not set the default menu item from ShellView_DoContextMenu().
This was added in f045c9df8130db17e4d379b56744f21f9a1491f8, with no explanation.
It does not affect any behaviour in Wine, since FWF_DESKTOP is never set.
It does not make sense, since "open" is already usually the default action on
Windows, and it's not obvious why FWF_DESKTOP would affect this.
It also leans on IContextMenu implementation details.
---
dlls/shell32/shlview.c | 3 ---
1 file changed, 3 deletions(-)
diff --git a/dlls/shell32/shlview.c b/dlls/shell32/shlview.c
index abe13981df1..9c699ecda08 100644
--- a/dlls/shell32/shlview.c
+++ b/dlls/shell32/shlview.c
@@ -1039,9 +1039,6 @@ static void ShellView_DoContextMenu(IShellViewImpl * This, WORD x, WORD y, BOOL
/* let the ContextMenu merge its items in */
if (SUCCEEDED(IContextMenu_QueryContextMenu( pContextMenu, hMenu, 0, FCIDM_SHVIEWFIRST, FCIDM_SHVIEWLAST, wFlags )))
{
- if (This->FolderSettings.fFlags & FWF_DESKTOP)
- SetMenuDefaultItem(hMenu, FCIDM_SHVIEW_OPEN, MF_BYCOMMAND);
-
if( bDefault )
{
TRACE("-- get menu default command\n");
Module: wine
Branch: master
Commit: d9c4f506fd10dc59807790a51e78a2cb5579b9a5
URL: https://gitlab.winehq.org/wine/wine/-/commit/d9c4f506fd10dc59807790a51e78a2…
Author: Zebediah Figura <zfigura(a)codeweavers.com>
Date: Fri Feb 16 21:48:04 2024 -0600
shell32: Always use IContextMenu::InvokeCommand() when selecting an item from the context menu.
This reverts one of the changes included in d30dfd24d6ab2f52bb4f29aee59e75238c648fc4.
Relying on FCIDM_SHVIEW_OPEN snoops into the internals of IContextMenu for no
good reason.
While I haven't tested whether ICommDlgBrowser::OnDefaultCommand() is triggered
in this case, the documentation states that it is "called when a user
double-clicks in the view or presses the ENTER key"; this is neither scenario.
Simply let the context menu call ShellExecuteEx().
---
dlls/shell32/shlview.c | 13 -------------
1 file changed, 13 deletions(-)
diff --git a/dlls/shell32/shlview.c b/dlls/shell32/shlview.c
index bb1119355ab..abe13981df1 100644
--- a/dlls/shell32/shlview.c
+++ b/dlls/shell32/shlview.c
@@ -1055,24 +1055,11 @@ static void ShellView_DoContextMenu(IShellViewImpl * This, WORD x, WORD y, BOOL
if(uCommand > 0)
{
- TRACE("-- uCommand=%u\n", uCommand);
- if (uCommand==FCIDM_SHVIEW_OPEN && IsInCommDlg(This))
- {
- TRACE("-- dlg: OnDefaultCommand\n");
- if (OnDefaultCommand(This) != S_OK)
- {
- ShellView_OpenSelectedItems(This);
- }
- }
- else
- {
- TRACE("-- explore -- invoke command\n");
ZeroMemory(&cmi, sizeof(cmi));
cmi.cbSize = sizeof(cmi);
cmi.hwnd = This->hWndParent; /* this window has to answer CWM_GETISHELLBROWSER */
cmi.lpVerb = MAKEINTRESOURCEA(uCommand);
IContextMenu_InvokeCommand(pContextMenu, &cmi);
- }
}
DestroyMenu(hMenu);
}