Dmitry Timoshkov : ieframe: When activating UI also activate the embedded document.

Alexandre Julliard julliard at winehq.org
Fri Aug 14 16:39:31 CDT 2020


Module: wine
Branch: master
Commit: 44a983f650cfc07848bf29027aca8d8b83634d5a
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=44a983f650cfc07848bf29027aca8d8b83634d5a

Author: Dmitry Timoshkov <dmitry at baikal.ru>
Date:   Fri Aug 14 15:04:03 2020 +0800

ieframe: When activating UI also activate the embedded document.

Signed-off-by: Dmitry Timoshkov <dmitry at baikal.ru>
Signed-off-by: Jacek Caban <jacek at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 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 46d5cc5dd1..042417b5b1 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 24d490c272..a35507e6fb 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 a2f87dda2f..be0e6ec5bf 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;




More information about the wine-cvs mailing list