From f5ef66a36951f88542d3bce8a612c5897d9f9314 Mon Sep 17 00:00:00 2001 From: Jacek Caban Date: Tue, 2 Oct 2007 14:20:59 +0200 Subject: [PATCH] mshtml: Pass the IDispatch interface of the element right-clicked on to IDocHostUIHandler_ShowContextMenu if applicable instead of always the document's one. Found by Rob Shearman. --- dlls/mshtml/mshtml_private.h | 2 +- dlls/mshtml/nsembed.c | 2 +- dlls/mshtml/olecmd.c | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/dlls/mshtml/mshtml_private.h b/dlls/mshtml/mshtml_private.h index 3038d6fe38a..3db047fd25a 100644 --- a/dlls/mshtml/mshtml_private.h +++ b/dlls/mshtml/mshtml_private.h @@ -362,7 +362,7 @@ NSContainer *NSContainer_Create(HTMLDocument*,NSContainer*); void NSContainer_Release(NSContainer*); void HTMLDocument_LockContainer(HTMLDocument*,BOOL); -void show_context_menu(HTMLDocument*,DWORD,POINT*); +void show_context_menu(HTMLDocument*,DWORD,POINT*,IDispatch*); void notif_focus(HTMLDocument*); void show_tooltip(HTMLDocument*,DWORD,DWORD,LPCWSTR); diff --git a/dlls/mshtml/nsembed.c b/dlls/mshtml/nsembed.c index 19bf85c1233..23b219397f9 100644 --- a/dlls/mshtml/nsembed.c +++ b/dlls/mshtml/nsembed.c @@ -997,7 +997,7 @@ static nsresult NSAPI nsContextMenuListener_OnShowContextMenu(nsIContextMenuList FIXME("aContextFlags=%08x\n", aContextFlags); }; - show_context_menu(This->doc, dwID, &pt); + show_context_menu(This->doc, dwID, &pt, (IDispatch*)HTMLDOMNODE(get_node(This->doc, aNode))); return NS_OK; } diff --git a/dlls/mshtml/olecmd.c b/dlls/mshtml/olecmd.c index b33d305deb9..a137057bf6d 100644 --- a/dlls/mshtml/olecmd.c +++ b/dlls/mshtml/olecmd.c @@ -852,14 +852,14 @@ static const IOleCommandTargetVtbl OleCommandTargetVtbl = { OleCommandTarget_Exec }; -void show_context_menu(HTMLDocument *This, DWORD dwID, POINT *ppt) +void show_context_menu(HTMLDocument *This, DWORD dwID, POINT *ppt, IDispatch *elem) { HMENU menu_res, menu; DWORD cmdid; HRESULT hres; hres = IDocHostUIHandler_ShowContextMenu(This->hostui, dwID, ppt, - (IUnknown*)CMDTARGET(This), (IDispatch*)HTMLDOC(This)); + (IUnknown*)CMDTARGET(This), elem); if(hres == S_OK) return;