summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAnu Aliyas <anu.aliyas@qt.io>2024-01-25 13:15:45 +0100
committerMichael BrĂ¼ning <michael.bruning@qt.io>2024-04-09 20:14:17 +0200
commit634192eee035308d1d44fa57757d6517d2a4efef (patch)
tree59ff867dafdbb9116fe9a8d739e143267b71d0b2
parent991b1620f20ed673531301359c59d653b70904f5 (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 Change-Id: I6663008ee038f30ea6f5df8ab7d8ce7356b152a1 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io> (cherry picked from commit 85bfaa5274b5d47437d6e0634746f70a6646bd4e) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> (cherry picked from commit 603c969421b98a9a285128c589b2c32fded21033) (cherry picked from commit 798574d834610a80009192631e6720a00b57968d) Reviewed-by: Michal Klocek <michal.klocek@qt.io>
-rw-r--r--src/core/web_contents_delegate_qt.cpp3
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 64ccd529d..d00f66335 100644
--- a/src/core/web_contents_delegate_qt.cpp
+++ b/src/core/web_contents_delegate_qt.cpp
@@ -311,6 +311,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);
}
}