From 44a983f650cfc07848bf29027aca8d8b83634d5a Mon Sep 17 00:00:00 2001 From: Dmitry Timoshkov Date: Fri, 14 Aug 2020 15:04:03 +0800 Subject: [PATCH] ieframe: When activating UI also activate the embedded document. Signed-off-by: Dmitry Timoshkov Signed-off-by: Jacek Caban Signed-off-by: Alexandre Julliard --- dlls/ieframe/dochost.c | 26 ++++++++++++++++++++++++++ dlls/ieframe/ieframe.h | 1 + dlls/ieframe/oleobject.c | 2 ++ 3 files changed, 29 insertions(+) diff --git a/dlls/ieframe/dochost.c b/dlls/ieframe/dochost.c index 46d5cc5dd15..042417b5b17 100644 --- a/dlls/ieframe/dochost.c +++ b/dlls/ieframe/dochost.c @@ -598,6 +598,32 @@ HRESULT refresh_document(DocHost *This, const VARIANT *level) return S_OK; } +void activate_document(DocHost *This) +{ + IOleObject *oleobj; + IHlinkTarget *hlink; + HRESULT hres; + + if(!This->document) return; + + hres = IUnknown_QueryInterface(This->document, &IID_IHlinkTarget, (void**)&hlink); + if(SUCCEEDED(hres)) { + IHlinkTarget_Navigate(hlink, 0, NULL); + IHlinkTarget_Release(hlink); + } + + hres = IUnknown_QueryInterface(This->document, &IID_IOleObject, (void**)&oleobj); + if(SUCCEEDED(hres)) { + IOleObject_DoVerb(oleobj, OLEIVERB_SHOW, NULL, NULL, -1, 0, NULL); + IOleObject_Release(oleobj); + } + + refresh_document(This, NULL); + + if(This->view) + IOleDocumentView_UIActivate(This->view, TRUE); +} + void release_dochost_client(DocHost *This) { if(This->hwnd) { diff --git a/dlls/ieframe/ieframe.h b/dlls/ieframe/ieframe.h index 24d490c2722..a35507e6fb3 100644 --- a/dlls/ieframe/ieframe.h +++ b/dlls/ieframe/ieframe.h @@ -283,6 +283,7 @@ HRESULT set_dochost_url(DocHost*,const WCHAR*) DECLSPEC_HIDDEN; void handle_navigation_error(DocHost*,HRESULT,BSTR,IHTMLWindow2*) DECLSPEC_HIDDEN; HRESULT dochost_object_available(DocHost*,IUnknown*) DECLSPEC_HIDDEN; void set_doc_state(DocHost*,READYSTATE) DECLSPEC_HIDDEN; +void activate_document(DocHost*) DECLSPEC_HIDDEN; void deactivate_document(DocHost*) DECLSPEC_HIDDEN; void create_doc_view_hwnd(DocHost*) DECLSPEC_HIDDEN; void on_commandstate_change(DocHost*,LONG,BOOL) DECLSPEC_HIDDEN; diff --git a/dlls/ieframe/oleobject.c b/dlls/ieframe/oleobject.c index a2f87dda2fa..be0e6ec5bfc 100644 --- a/dlls/ieframe/oleobject.c +++ b/dlls/ieframe/oleobject.c @@ -230,6 +230,8 @@ static HRESULT activate_ui(WebBrowser *This, IOleClientSite *active_site) SetFocus(This->shell_embedding_hwnd); notify_on_focus(This, TRUE); + activate_document(&This->doc_host); + This->ui_activated = TRUE; return S_OK;