summaryrefslogtreecommitdiffstats
path: root/src/core/web_contents_delegate_qt.cpp
diff options
context:
space:
mode:
authorKirill Burtsev <kirill.burtsev@qt.io>2022-04-27 22:22:46 +0200
committerKirill Burtsev <kirill.burtsev@qt.io>2022-06-01 23:11:51 +0200
commit91d53ffd54eaa7e2f8cf1bc6e076d645a45a6bee (patch)
treef788603173239d20fc2049be9e29a0b95bf9b725 /src/core/web_contents_delegate_qt.cpp
parent0f5d840ac79bab96253f8a577fd16fcba2b7c79c (diff)
Keep page's zoom level on loading new urls
Ammends d236c5a8a3. Zoom level was set as a temporal one, which is invalidated each time when a renderer process or widget are changed (on new navigation, for example), so it needs to be reapplied. Fixes: QTBUG-101030 Change-Id: Iecff9686fbe2b79e99b46f67cab92f66127be085 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Michal Klocek <michal.klocek@qt.io> (cherry picked from commit 1e27d42a8071532b6cc30a9bcc5f700edc56952a)
Diffstat (limited to 'src/core/web_contents_delegate_qt.cpp')
-rw-r--r--src/core/web_contents_delegate_qt.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/core/web_contents_delegate_qt.cpp b/src/core/web_contents_delegate_qt.cpp
index e7bfa6510..d211bdbfc 100644
--- a/src/core/web_contents_delegate_qt.cpp
+++ b/src/core/web_contents_delegate_qt.cpp
@@ -318,8 +318,10 @@ void WebContentsDelegateQt::RenderFrameHostChanged(content::RenderFrameHost *old
if (new_host->GetFrameOwnerElementType() == blink::mojom::FrameOwnerElementType::kNone) {
content::RenderProcessHost *renderProcessHost = new_host->GetProcess();
const base::Process &process = renderProcessHost->GetProcess();
- if (process.IsValid())
+ if (process.IsValid()) {
m_viewClient->renderProcessPidChanged(process.Pid());
+ m_viewClient->zoomUpdateIsNeeded();
+ }
}
}
}
@@ -329,6 +331,7 @@ void WebContentsDelegateQt::RenderViewHostChanged(content::RenderViewHost *, con
if (newHost && newHost->GetWidget() && newHost->GetWidget()->GetView()) {
auto rwhv = static_cast<RenderWidgetHostViewQt *>(newHost->GetWidget()->GetView());
m_viewClient->widgetChanged(rwhv->delegate());
+ m_viewClient->zoomUpdateIsNeeded();
}
}