From 0bd8fe91e740a7823821b3d2df632e7e20b2f983 Mon Sep 17 00:00:00 2001 From: Josue Andrade Gomes Date: Wed, 22 Aug 2018 07:20:29 -0300 Subject: [PATCH] Fire wxEVT_WEBVIEW_NAVIGATING when redirecting When using IE wxWebView backend, this event wasn't generated as expected when the client was redirected. Fix this by using DOCHOSTUIFLAG_ENABLE_REDIRECT_NOTIFICATION flag. Closes https://github.com/wxWidgets/wxWidgets/pull/893 --- docs/changes.txt | 1 + include/wx/msw/webview_missing.h | 3 ++- src/msw/webview_ie.cpp | 8 ++++++-- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/docs/changes.txt b/docs/changes.txt index 5237bdc894..20794488ed 100644 --- a/docs/changes.txt +++ b/docs/changes.txt @@ -135,6 +135,7 @@ wxMSW: - Implement wxFontDialog::SetTitle() (Vitaly Stakhovsky). - Fix build in ANSI (non-Unicode) mode. - Improve wxNotebook themed background drawing (Arrigo Marchiori). +- Send wxEVT_WEBVIEW_NAVIGATING when redirecting (Josue Andrade Gomes). wxOSX: diff --git a/include/wx/msw/webview_missing.h b/include/wx/msw/webview_missing.h index 61a54a4e20..73820cc04a 100644 --- a/include/wx/msw/webview_missing.h +++ b/include/wx/msw/webview_missing.h @@ -165,7 +165,8 @@ typedef enum _tagwxDOCHOSTUIFLAG DOCHOSTUIFLAG_NO3DOUTERBORDER = 0x200000, DOCHOSTUIFLAG_DISABLE_EDIT_NS_FIXUP = 0x400000, DOCHOSTUIFLAG_LOCAL_MACHINE_ACCESS_CHECK = 0x800000, - DOCHOSTUIFLAG_DISABLE_UNTRUSTEDPROTOCOL = 0x1000000 + DOCHOSTUIFLAG_DISABLE_UNTRUSTEDPROTOCOL = 0x1000000, + DOCHOSTUIFLAG_ENABLE_REDIRECT_NOTIFICATION = 0x4000000 } DOCHOSTUIFLAG; typedef struct _tagwxDOCHOSTUIINFO diff --git a/src/msw/webview_ie.cpp b/src/msw/webview_ie.cpp index 819aba0654..2f98e83e0d 100644 --- a/src/msw/webview_ie.cpp +++ b/src/msw/webview_ie.cpp @@ -1640,8 +1640,12 @@ HRESULT wxSTDCALL DocHostUIHandler::ShowContextMenu(DWORD dwID, POINT *ppt, HRESULT wxSTDCALL DocHostUIHandler::GetHostInfo(DOCHOSTUIINFO *pInfo) { - //don't show 3d border and enable themes. - pInfo->dwFlags = pInfo->dwFlags | DOCHOSTUIFLAG_NO3DBORDER | DOCHOSTUIFLAG_THEME; + // Don't show 3d border and enable themes and also enable sending redirect + // notifications as otherwise we wouldn't get wxEVT_WEBVIEW_NAVIGATING when + // redirected. + pInfo->dwFlags |= DOCHOSTUIFLAG_NO3DBORDER | + DOCHOSTUIFLAG_THEME | + DOCHOSTUIFLAG_ENABLE_REDIRECT_NOTIFICATION; return S_OK; }