diff options
author | Anu Aliyas <anu.aliyas@qt.io> | 2024-01-25 13:15:45 +0100 |
---|---|---|
committer | Anu Aliyas <anu.aliyas@qt.io> | 2024-02-13 10:16:28 +0100 |
commit | 85bfaa5274b5d47437d6e0634746f70a6646bd4e (patch) | |
tree | 852a1fc7c12c72e7c0d4a449d446e21cc58e7188 | |
parent | 5c73b7f5719b61aad1d7709fee3f810732bb3fba (diff) |
Keep page's background color when loading new URLs
Whenever a new URL is loaded, the background color is reset to white,
even if the user has explicitly set the background color to a different
value. Therefore, it needs to be reapplied when a new render widget is
created.
Fixes: QTBUG-112013
Fixes: QTBUG-120926
Pick-to: 6.7 6.6
Change-Id: I6663008ee038f30ea6f5df8ab7d8ce7356b152a1
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
-rw-r--r-- | src/core/web_contents_delegate_qt.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/core/web_contents_delegate_qt.cpp b/src/core/web_contents_delegate_qt.cpp index 38ca7d5d6..194274fcb 100644 --- a/src/core/web_contents_delegate_qt.cpp +++ b/src/core/web_contents_delegate_qt.cpp @@ -314,6 +314,9 @@ void WebContentsDelegateQt::RenderViewHostChanged(content::RenderViewHost *, con Q_ASSERT(rwhv->delegate()); rwhv->delegate()->adapterClientChanged(m_viewClient); m_viewClient->zoomUpdateIsNeeded(); + auto backgroundColor = m_viewClient->backgroundColor(); + if (backgroundColor != Qt::white) + m_viewClient->webContentsAdapter()->setBackgroundColor(backgroundColor); } } |