fix: web backgrounds should work on multiple screens now

This commit is contained in:
Almamu 2024-05-07 04:23:59 +02:00
parent 9e271a2b39
commit f20b2a0c37

View File

@ -10,8 +10,8 @@ CWeb::CWeb (Core::CWeb* web, CRenderContext& context, CAudioContext& audioContex
CWebBrowserContext& browserContext, CWebBrowserContext& browserContext,
const CWallpaperState::TextureUVsScaling& scalingMode) : const CWallpaperState::TextureUVsScaling& scalingMode) :
CWallpaper (web, Type, context, audioContext, scalingMode), CWallpaper (web, Type, context, audioContext, scalingMode),
m_width (context.getOutput ().getFullWidth ()), m_width (16),
m_height (context.getOutput ().getFullHeight ()), m_height (16),
m_browserContext (browserContext), m_browserContext (browserContext),
m_browser (), m_browser (),
m_client () { m_client () {
@ -55,6 +55,11 @@ void CWeb::setSize (int64_t width, int64_t height) {
} }
void CWeb::renderFrame (glm::ivec4 viewport) { void CWeb::renderFrame (glm::ivec4 viewport) {
// ensure the viewport matches the window size, and resize if needed
if (viewport.z != this->getWidth() || viewport.w != this->getHeight()) {
this->setSize(viewport.z, viewport.w);
}
// ensure the virtual mouse position is up to date // ensure the virtual mouse position is up to date
this->updateMouse (viewport); this->updateMouse (viewport);
// use the scene's framebuffer by default // use the scene's framebuffer by default